From d486cefce8bc1b1e3824442825bddd96b14a3d1b Mon Sep 17 00:00:00 2001 From: Dailer Date: Sun, 26 Aug 2018 16:28:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=20removeAll=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/controller/controller.layer.js | 11 +++++++++++ src/core/controller/controller.popover.js | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index 95212f452..3fbc03c22 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -155,5 +155,16 @@ BI.LayerController = BI.inherit(BI.Controller, { delete this.layerManager[name]; delete this.layouts[name]; return this; + }, + + removeAll: function () { + var self = this; + BI.each(BI.keys(this.layerManager), function (index, name) { + self.layerManager[name].destroy(); + self.layouts[name].destroy(); + }); + this.layerManager = {}; + this.layouts = {}; + return this; } }); \ No newline at end of file diff --git a/src/core/controller/controller.popover.js b/src/core/controller/controller.popover.js index d8367fcda..b35db5d4c 100644 --- a/src/core/controller/controller.popover.js +++ b/src/core/controller/controller.popover.js @@ -138,5 +138,19 @@ BI.PopoverController = BI.inherit(BI.Controller, { delete this.floatContainer[name]; delete this.floatOpened[name]; return this; + }, + + removeAll: function () { + var self = this; + BI.each(this.floatContainer, function (name, container) { + container.destroy(); + self.modal && self.floatContainer[name].element.__releaseZIndexMask__(self.zindexMap[name]); + }); + this.floatManager = {}; + this.floatLayer = {}; + this.floatContainer = {}; + this.floatOpened = {}; + this.zindexMap = {}; + return this; } }); \ No newline at end of file