From 396d835f53884f58a9f5008ffa8dc909139b1d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kay=20=C5=9Eat=C4=B1r?= Date: Fri, 3 May 2024 16:23:11 +0300 Subject: [PATCH] Container is rendered on the server side. It should always be visible when the function is called. Rename the function to _setPreviewContainerTop for readability. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gökay Şatır Change-Id: Ib90da34574b0a5a44c9a2e7a2b2d64cdd2d59938 --- browser/src/control/Control.PartsPreview.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/browser/src/control/Control.PartsPreview.js b/browser/src/control/Control.PartsPreview.js index bb857ebc31..586de9639d 100644 --- a/browser/src/control/Control.PartsPreview.js +++ b/browser/src/control/Control.PartsPreview.js @@ -89,7 +89,7 @@ L.Control.PartsPreview = L.Control.extend({ }, this), 500); } - this._getBottomBound(); + this._setPreviewContainerTop(); // Add a special frame just as a drop-site for reordering. var frameClass = 'preview-frame ' + this.options.frameClass; @@ -353,14 +353,9 @@ L.Control.PartsPreview = L.Control.extend({ return img; }, - _getBottomBound: function () { + _setPreviewContainerTop: function () { var previewContBB = this._partsPreviewCont.getBoundingClientRect(); - // is not visible yet, assume map bounds - if (previewContBB.right === 0 && previewContBB.bottom === 0) { - previewContBB = this._map._container.getBoundingClientRect(); - } - if (this._direction === 'x') { this._previewContTop = previewContBB.left; } else {