|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|