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: Ib90da34574b0a5a44c9a2e7a2b2d64cdd2d59938pull/8999/head
parent
45c51c42de
commit
396d835f53
|
@ -89,7 +89,7 @@ L.Control.PartsPreview = L.Control.extend({
|
||||||
}, this), 500);
|
}, this), 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._getBottomBound();
|
this._setPreviewContainerTop();
|
||||||
|
|
||||||
// Add a special frame just as a drop-site for reordering.
|
// Add a special frame just as a drop-site for reordering.
|
||||||
var frameClass = 'preview-frame ' + this.options.frameClass;
|
var frameClass = 'preview-frame ' + this.options.frameClass;
|
||||||
|
@ -353,14 +353,9 @@ L.Control.PartsPreview = L.Control.extend({
|
||||||
return img;
|
return img;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getBottomBound: function () {
|
_setPreviewContainerTop: function () {
|
||||||
var previewContBB = this._partsPreviewCont.getBoundingClientRect();
|
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') {
|
if (this._direction === 'x') {
|
||||||
this._previewContTop = previewContBB.left;
|
this._previewContTop = previewContBB.left;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue