Container is rendered on the server side.

It should always be visible when the function is called.
Rename the function to _setPreviewContainerTop for readability.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ib90da34574b0a5a44c9a2e7a2b2d64cdd2d59938
pull/8999/head
Gökay Şatır 2024-05-03 16:23:11 +03:00 committed by Gökay ŞATIR
parent 45c51c42de
commit 396d835f53
1 changed files with 2 additions and 7 deletions

View File

@ -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 {