From 0e88491a121e9b9efe73808869b0bfb2908d3f32 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 4 Apr 2022 22:50:32 +0800 Subject: [PATCH 1/2] feature: dom --- src/core/platform/web/dom.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 52976e103..5836ed683 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -628,20 +628,20 @@ return pos; default : if (BI.DOM.isBottomSpaceLarger(combo)) { - pos = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight); + top = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top; firstDir = "bottom"; } else { - pos = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight); + top = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top; firstDir = "top"; } if (leftRight[0] === "right") { - left = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left; - pos.left = left; + pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left; + pos.top = top; pos.dir = firstDir + "," + pos.dir; return pos; } - left = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left; - pos.left = left; + pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left; + pos.top = top; pos.dir = firstDir + "," + pos.dir; return pos; } From 9857dab14e17cc264826359c38a3f8f4f4383174 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 4 Apr 2022 22:57:56 +0800 Subject: [PATCH 2/2] update --- src/base/layer/layer.popup.js | 2 +- src/core/platform/web/dom.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 5ad4f064d..8e747d24f 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -185,7 +185,7 @@ BI.PopupView = BI.inherit(BI.Widget, { setDirection: function (direction, position) { var o = this.options; if (o.showArrow) { - var style, wrapperStyle, placeholderStyle; + var style = {}, wrapperStyle = {}, placeholderStyle = {}; var adjustXOffset = position.adjustXOffset || 0; var adjustYOffset = position.adjustYOffset || 0; var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds(); diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 5836ed683..05757959d 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -635,12 +635,12 @@ firstDir = "top"; } if (leftRight[0] === "right") { - pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left; + pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight); pos.top = top; pos.dir = firstDir + "," + pos.dir; return pos; } - pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left; + pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth); pos.top = top; pos.dir = firstDir + "," + pos.dir; return pos;