From 3912039d66d37fac459b8ca7ea6713d13117ab7e Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 5 Sep 2020 12:04:17 +0800 Subject: [PATCH 1/2] bugfix --- src/core/controller/controller.bubbles.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index e95f805d3..e1bb50cfd 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -234,6 +234,8 @@ BI.BubblesController = BI.inherit(BI.Controller, { } } } + this.get(name).setText(text); + this.get(name).visible(); return this; }, From cb828e51511bfd6e85c47a866d47220cea0c1c55 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 5 Sep 2020 12:06:06 +0800 Subject: [PATCH 2/2] bugfix --- src/core/controller/controller.bubbles.js | 69 ++++++++++++----------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index e1bb50cfd..8a6fd42ae 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -179,58 +179,61 @@ BI.BubblesController = BI.inherit(BI.Controller, { break; } } - return this; - } - var position = this._getTopPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + adjustXOffset, top: position.top - adjustYOffset}); - if (!BI.DOM.isTopSpaceEnough(context, this.get(name), adjustYOffset)) { - this.get(name).invisible(); - if (!this.storeBubbles[name]["bottom"]) { - this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level); - } - BI.createWidget({ - type: "bi.absolute", - element: container, - items: [{ - el: this.storeBubbles[name]["bottom"] - }] - }); - this.set(name, this.storeBubbles[name]["bottom"]); - var position = this._getBottomPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + adjustXOffset, top: position.top + adjustYOffset}); - if (!BI.DOM.isBottomSpaceEnough(context, this.get(name), adjustYOffset)) { + } else { + var position = this._getTopPosition(name, context, offsetStyle); + this.get(name).element.css({left: position.left + adjustXOffset, top: position.top - adjustYOffset}); + if (!BI.DOM.isTopSpaceEnough(context, this.get(name), adjustYOffset)) { this.get(name).invisible(); - if (!this.storeBubbles[name]["right"]) { - this.storeBubbles[name]["right"] = this._createBubble("right", text, level); + if (!this.storeBubbles[name]["bottom"]) { + this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level); } BI.createWidget({ type: "bi.absolute", element: container, items: [{ - el: this.storeBubbles[name]["right"] + el: this.storeBubbles[name]["bottom"] }] }); - this.set(name, this.storeBubbles[name]["right"]); - var position = this._getRightPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + adjustXOffset, top: position.top - adjustYOffset}); - if (!BI.DOM.isRightSpaceEnough(context, this.get(name), adjustXOffset)) { + this.set(name, this.storeBubbles[name]["bottom"]); + var position = this._getBottomPosition(name, context, offsetStyle); + this.get(name).element.css({left: position.left + adjustXOffset, top: position.top + adjustYOffset}); + if (!BI.DOM.isBottomSpaceEnough(context, this.get(name), adjustYOffset)) { this.get(name).invisible(); - if (!this.storeBubbles[name]["left"]) { - this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30); + if (!this.storeBubbles[name]["right"]) { + this.storeBubbles[name]["right"] = this._createBubble("right", text, level); } BI.createWidget({ type: "bi.absolute", element: container, items: [{ - el: this.storeBubbles[name]["left"] + el: this.storeBubbles[name]["right"] }] }); - this.set(name, this.storeBubbles[name]["left"]); - var position = this._getLeftPosition(name, context, offsetStyle); + this.set(name, this.storeBubbles[name]["right"]); + var position = this._getRightPosition(name, context, offsetStyle); this.get(name).element.css({ - left: position.left - adjustXOffset, + left: position.left + adjustXOffset, top: position.top - adjustYOffset }); + if (!BI.DOM.isRightSpaceEnough(context, this.get(name), adjustXOffset)) { + this.get(name).invisible(); + if (!this.storeBubbles[name]["left"]) { + this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30); + } + BI.createWidget({ + type: "bi.absolute", + element: container, + items: [{ + el: this.storeBubbles[name]["left"] + }] + }); + this.set(name, this.storeBubbles[name]["left"]); + var position = this._getLeftPosition(name, context, offsetStyle); + this.get(name).element.css({ + left: position.left - adjustXOffset, + top: position.top - adjustYOffset + }); + } } } }