|
|
@ -29,24 +29,29 @@ |
|
|
|
* @abstract |
|
|
|
* @abstract |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
BI.OB = function (config) { |
|
|
|
BI.OB = function (config) { |
|
|
|
var props = this.props; |
|
|
|
this.__config = config; |
|
|
|
if (BI.isFunction(this.props)) { |
|
|
|
this._constructor(); |
|
|
|
props = this.props(config); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.options = extend(this._defaultConfig(config), props, config); |
|
|
|
|
|
|
|
this._init(); |
|
|
|
|
|
|
|
this._initRef(); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
_.extend(BI.OB.prototype, { |
|
|
|
_.extend(BI.OB.prototype, { |
|
|
|
props: {}, |
|
|
|
props: {}, |
|
|
|
init: null, |
|
|
|
init: null, |
|
|
|
destroyed: null, |
|
|
|
destroyed: null, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_constructor: function () { |
|
|
|
|
|
|
|
this._init(); |
|
|
|
|
|
|
|
this._initRef(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig: function (config) { |
|
|
|
_defaultConfig: function (config) { |
|
|
|
return {}; |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
|
|
|
|
var props = this.props; |
|
|
|
|
|
|
|
if (BI.isFunction(this.props)) { |
|
|
|
|
|
|
|
props = this.props(this.__config); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.options = extend(this._defaultConfig(this.__config), props, this.__config); |
|
|
|
this._initListeners(); |
|
|
|
this._initListeners(); |
|
|
|
this.init && this.init(); |
|
|
|
this.init && this.init(); |
|
|
|
}, |
|
|
|
}, |
|
|
|