Browse Source

移动端适配

es6
guy 4 years ago
parent
commit
8c1bff398b
  1. 14
      src/core/widget.js

14
src/core/widget.js

@ -7,7 +7,7 @@
*/ */
!(function () { !(function () {
function callLifeHook (self, life) { function callLifeHook(self, life) {
var hook = self.options[life] || self[life]; var hook = self.options[life] || self[life];
if (hook) { if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook]; var hooks = BI.isArray(hook) ? hook : [hook];
@ -197,9 +197,11 @@
} }
if (BI.isArray(els)) { if (BI.isArray(els)) {
BI.each(els, function (i, el) { BI.each(els, function (i, el) {
BI._lazyCreateWidget(el, { if (el) {
element: self BI._lazyCreateWidget(el, {
}); element: self
});
}
}); });
} }
// if (this._isRoot === true || !(this instanceof BI.Layout)) { // if (this._isRoot === true || !(this instanceof BI.Layout)) {
@ -532,12 +534,12 @@
BI.Widget.context = context = contextStack.pop(); BI.Widget.context = context = contextStack.pop();
}; };
function pushTarget (_current) { function pushTarget(_current) {
if (current) currentStack.push(current); if (current) currentStack.push(current);
BI.Widget.current = current = _current; BI.Widget.current = current = _current;
} }
function popTarget () { function popTarget() {
BI.Widget.current = current = currentStack.pop(); BI.Widget.current = current = currentStack.pop();
} }

Loading…
Cancel
Save