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