Browse Source

整理代码

master
guy 4 years ago
parent
commit
9bbe7bef91
  1. 15
      src/core/4.widget.js

15
src/core/4.widget.js

@ -8,13 +8,18 @@
!(function () {
function callLifeHook (self, life) {
var hook = self.options[life] || self[life];
var hooks = [], hook;
hook = self[life];
if (hook) {
var hooks = BI.isArray(hook) ? hook : [hook];
BI.each(hooks, function (i, hook) {
hook.call(self);
});
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) {
hook.call(self);
});
}
BI.Widget = BI.Widget || BI.inherit(BI.OB, {

Loading…
Cancel
Save