From 91cd220e35b216d694692044f5961eb00405ca86 Mon Sep 17 00:00:00 2001 From: Quinton Jason Date: Thu, 19 Oct 2023 14:16:59 -0500 Subject: [PATCH] chore(dropdown): remove whitespace and console logs --- packages/sage-system/lib/dropdown.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/sage-system/lib/dropdown.js b/packages/sage-system/lib/dropdown.js index faad472a09..f1a35d6171 100644 --- a/packages/sage-system/lib/dropdown.js +++ b/packages/sage-system/lib/dropdown.js @@ -198,7 +198,7 @@ Sage.dropdown = (function () { const panel = el.lastElementChild; const win = panel.ownerDocument.defaultView; const docEl = window.document.documentElement; - + panel.style.top = ''; // resets the style panel.style.left = ''; // resets the style panel.style.right = ''; // resets the style @@ -206,7 +206,7 @@ Sage.dropdown = (function () { // Dimensions const buttonDimensions = button.getBoundingClientRect(); const panelDimensions = panel.getBoundingClientRect(); - + const panelNewLoc = { top: (buttonDimensions.height / 2) + panelDimensions.height, left: (buttonDimensions.width / 2) + panelDimensions.width, @@ -225,7 +225,7 @@ Sage.dropdown = (function () { bottom: (panelDimensions.top + win.pageYOffset), right: (panelDimensions.left + win.pageXOffset), }; - + const panelHeight = getHeight(panel); const panelWidth = panelDimensions.width; const enoughSpaceAbove = viewport.top < (offset.top + panelHeight); @@ -239,7 +239,7 @@ Sage.dropdown = (function () { } else if (!enoughSpaceAbove && enoughSpaceBelow) { directionY = 'below'; } - + if (directionY === 'above') { panel.style.top = `-${panelNewLoc.top}px`; } else if (directionY === 'below') { @@ -261,9 +261,6 @@ Sage.dropdown = (function () { panel.style.left = 0; panel.style.right = 'inherit'; } - - console.log('directionX', directionX); - console.log('directionY', directionY); } function open(el) {