From 446ceb64051730805f5fca5cc61c92d6fb2e841c Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 22 Jul 2021 19:40:14 +0800 Subject: [PATCH 1/2] bugfix --- src/core/controller/controller.bubbles.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index b31843d2f..d020e8aea 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -20,7 +20,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { */ show: function (name, text, context, opt) { opt || (opt = {}); - var container = opt.container || "body"; + var container = opt.container || context; var offsetStyle = opt.offsetStyle || "left"; var level = opt.level || "error"; var adjustYOffset = opt.adjustYOffset || 0; @@ -76,9 +76,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { if (!this.has(name)) { return this; } - BI.each(this.storeBubbles, function (dir, bubble) { - bubble.destroy(); - }); + this.storeBubbles[name].destroy(); delete this.storeBubbles[name]; return this; } From daf719b600435cd0884459be0ca4101b1dbd0180 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 22 Jul 2021 19:40:50 +0800 Subject: [PATCH 2/2] bugfix --- src/core/controller/controller.bubbles.js | 83 ----------------------- 1 file changed, 83 deletions(-) delete mode 100644 src/core/controller/controller.bubbles.js diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js deleted file mode 100644 index d020e8aea..000000000 --- a/src/core/controller/controller.bubbles.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * 气泡图控制器 - * 控制气泡图的显示方向 - * - * Created by GUY on 2015/8/21. - * @class - */ -BI.BubblesController = BI.inherit(BI.Controller, { - init: function () { - this.storeBubbles = {}; - }, - - /** - * - * @param name - * @param text - * @param context - * @param offsetStyle center, left, right三种类型, 默认left - * @returns {BI.BubblesController} - */ - show: function (name, text, context, opt) { - opt || (opt = {}); - var container = opt.container || context; - var offsetStyle = opt.offsetStyle || "left"; - var level = opt.level || "error"; - var adjustYOffset = opt.adjustYOffset || 0; - var adjustXOffset = opt.adjustXOffset || 0; - // var fixed = opt.fixed !== false; - - if (!this.storeBubbles[name]) { - this.storeBubbles[name] = BI.createWidget({ - type: "bi.label", - cls: "bi-bubble" + " bubble-" + level, - text: text, - hgap: 5, - height: 18 - }); - } - var bubble = this.storeBubbles[name]; - - BI.createWidget({ - type: "bi.default", - element: container, - items: [{ - el: bubble - }] - }); - BI.Popper.createPopper(context.element[0], bubble.element[0], { - placement: ({ - left: "top-start", - center: "top", - right: "top-end" - })[offsetStyle], - strategy: "fixed", - modifiers: [ - { - name: "offset", - options: { - offset: [adjustXOffset, adjustYOffset] - } - } - ] - }); - return this; - }, - - hide: function (name) { - this.remove(name); - }, - - has: function (name) { - return this.storeBubbles[name] != null; - }, - - remove: function (name) { - if (!this.has(name)) { - return this; - } - this.storeBubbles[name].destroy(); - delete this.storeBubbles[name]; - return this; - } -});