Browse Source

加 removeAll 方法

es6
Dailer 6 years ago
parent
commit
d486cefce8
  1. 11
      src/core/controller/controller.layer.js
  2. 14
      src/core/controller/controller.popover.js

11
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;
}
});

14
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;
}
});
Loading…
Cancel
Save