Browse Source

Pull request #3028: KERNEL-12552 && REPORT-79374 fix: 不执行BI.init(),很多方法调用会出现问题

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '8860119c2927f40be580b22c47efee8dd5cf17fa':
  KERNEL-12552 && REPORT-79374 fix:  不执行BI.init(),很多方法调用会出现问题
es6
Dailer 2 years ago
parent
commit
22672b3050
  1. 6
      src/core/controller/controller.layer.js
  2. 17
      src/core/controller/controller.resizer.js

6
src/core/controller/controller.layer.js

@ -15,7 +15,10 @@ BI.LayerController = BI.inherit(BI.Controller, {
this.layerManager = {};
this.layouts = {};
this.zindex = BI.zIndex_layer;
BI.Resizers.add("layerController" + BI.uniqueId(), BI.bind(this._resize, this));
},
_initResizer: function () {
this.resizer = BI.Resizers.add("layerController" + BI.uniqueId(), BI.bind(this._resize, this));
},
_resize: function () {
@ -38,6 +41,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
},
create: function (name, from, op, context) {
BI.isNull(this.resizer) && this._initResizer();
if (this.has(name)) {
return this.get(name);
}

17
src/core/controller/controller.resizer.js

@ -5,18 +5,20 @@
* @class
*/
BI.ResizeController = BI.inherit(BI.Controller, {
init: function () {
var self = this;
this.resizerManger = {};
var fn = BI.debounce(function (ev) {
// if (BI.isWindow(ev.target)) {
},
_initResizeListener: function () {
var self = this;
this.resizeHandler = BI.debounce(function (ev) {
self._resize(ev);
// }
}, 30);
if ("onorientationchange" in _global) {
_global.onorientationchange = fn;
_global.onorientationchange = this.resizeHandler;
} else {
BI.Widget._renderEngine.createElement(_global).resize(fn);
BI.Widget._renderEngine.createElement(_global).resize(this.resizeHandler);
}
},
@ -34,13 +36,14 @@ BI.ResizeController = BI.inherit(BI.Controller, {
}
if (BI.isFunction(resizer)) {
resizer(ev);
return;
}
});
},
add: function (name, resizer) {
var self = this;
BI.isNull(this.resizeHandler) && this._initResizeListener();
if (this.has(name)) {
return this;
}

Loading…
Cancel
Save