From 7db095322c42b9d403d612a702c4ccc4ce594a70 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 8 Aug 2021 13:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=86=85=E5=AD=98=E6=B3=84?= =?UTF-8?q?=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/controller/controller.bubbles.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index 5c38994c8..a705ef4a6 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -8,6 +8,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { init: function () { this.storeBubbles = {}; + this.storePoppers = {}; }, /** @@ -48,7 +49,10 @@ BI.BubblesController = BI.inherit(BI.Controller, { el: bubble }] }); - BI.Popper.createPopper(context.element[0], bubble.element[0], { + if (this.storePoppers[name]) { + this.storePoppers[name].destroy(); + } + this.storePoppers[name] = BI.Popper.createPopper(context.element[0], bubble.element[0], { placement: ({ left: "top-start", center: "top", @@ -81,6 +85,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { return this; } this.storeBubbles[name].destroy(); + this.storePoppers[name] && this.storePoppers[name].destroy(); delete this.storeBubbles[name]; return this; }, @@ -89,7 +94,11 @@ BI.BubblesController = BI.inherit(BI.Controller, { BI.each(this.storeBubbles, function (name, bubble) { bubble.destroy(); }); + BI.each(this.storePoppers, function (name, popper) { + popper.destroy(); + }); this.storeBubbles = {}; + this.storePoppers = {}; return this; } });