Browse Source

整理代码

es6
guy 4 years ago
parent
commit
9bbe7bef91
  1. 11
      src/core/4.widget.js

11
src/core/4.widget.js

@ -8,14 +8,19 @@
!(function () { !(function () {
function callLifeHook (self, life) { function callLifeHook (self, life) {
var hook = self.options[life] || self[life]; var hooks = [], hook;
hook = self[life];
if (hook) { if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook]; hooks = hooks.concat(BI.isArray(hook) ? hook : [hook]);
}
hook = self.options[life];
if (hook) {
hooks = hooks.concat(BI.isArray(hook) ? hook : [hook]);
}
BI.each(hooks, function (i, hook) { BI.each(hooks, function (i, hook) {
hook.call(self); hook.call(self);
}); });
} }
}
BI.Widget = BI.Widget || BI.inherit(BI.OB, { BI.Widget = BI.Widget || BI.inherit(BI.OB, {
_defaultConfig: function () { _defaultConfig: function () {

Loading…
Cancel
Save