From 7e657f33e268c25deb734f202a6dd6ac9a43feb8 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Fri, 29 Mar 2024 12:33:41 +0000 Subject: [PATCH] Rename el to container --- web_src/js/features/imagediff.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js index ab3cc3142f9e3..192a64283473b 100644 --- a/web_src/js/features/imagediff.js +++ b/web_src/js/features/imagediff.js @@ -118,7 +118,7 @@ export function initImageDiff() { this.querySelector(':scope > .image-diff-tabs')?.classList.remove('is-loading'); - function initSideBySide(el, sizes) { + function initSideBySide(container, sizes) { let factor = 1; if (sizes.max.width > (diffContainerWidth - 24) / 2) { factor = (diffContainerWidth - 24) / 2 / sizes.max.width; @@ -127,21 +127,21 @@ export function initImageDiff() { const widthChanged = sizes.$image1.length !== 0 && sizes.$image2.length !== 0 && sizes.$image1[0].naturalWidth !== sizes.$image2[0].naturalWidth; const heightChanged = sizes.$image1.length !== 0 && sizes.$image2.length !== 0 && sizes.$image1[0].naturalHeight !== sizes.$image2[0].naturalHeight; if (sizes.$image1?.length) { - const boundsInfoAfterWidth = el.querySelector('.bounds-info-after .bounds-info-width'); + const boundsInfoAfterWidth = container.querySelector('.bounds-info-after .bounds-info-width'); boundsInfoAfterWidth.textContent = `${sizes.$image1[0].naturalWidth}px`; if (widthChanged) boundsInfoAfterWidth.classList.add('green'); - const boundsInfoAfterHeight = el.querySelector('.bounds-info-after .bounds-info-height'); + const boundsInfoAfterHeight = container.querySelector('.bounds-info-after .bounds-info-height'); boundsInfoAfterHeight.textContent = `${sizes.$image1[0].naturalHeight}px`; if (heightChanged) boundsInfoAfterHeight.classList.add('green'); } if (sizes.$image2?.length) { - const boundsInfoBeforeWidth = el.querySelector('.bounds-info-before .bounds-info-width'); + const boundsInfoBeforeWidth = container.querySelector('.bounds-info-before .bounds-info-width'); boundsInfoBeforeWidth.textContent = `${sizes.$image2[0].naturalWidth}px`; if (widthChanged) boundsInfoBeforeWidth.classList.add('red'); - const boundsInfoBeforeHeight = el.querySelector('.bounds-info-before .bounds-info-height'); + const boundsInfoBeforeHeight = container.querySelector('.bounds-info-before .bounds-info-height'); boundsInfoBeforeHeight.textContent = `${sizes.$image2[0].naturalHeight}px`; if (heightChanged) boundsInfoBeforeHeight.classList.add('red'); }