|
|
@ -29,23 +29,31 @@ |
|
|
|
* @abstract |
|
|
|
* @abstract |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
BI.OB = function (config) { |
|
|
|
BI.OB = function (config) { |
|
|
|
var props = this.props; |
|
|
|
this._constructor(config); |
|
|
|
if (BI.isFunction(this.props)) { |
|
|
|
|
|
|
|
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 (config) { |
|
|
|
|
|
|
|
this._initProps(config); |
|
|
|
|
|
|
|
this._init(); |
|
|
|
|
|
|
|
this._initRef(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig: function (config) { |
|
|
|
_defaultConfig: function (config) { |
|
|
|
return {}; |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_initProps: function (config) { |
|
|
|
|
|
|
|
var props = this.props; |
|
|
|
|
|
|
|
if (BI.isFunction(this.props)) { |
|
|
|
|
|
|
|
props = this.props(config); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.options = extend(this._defaultConfig(config), props, config); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
this._initListeners(); |
|
|
|
this._initListeners(); |
|
|
|
this.init && this.init(); |
|
|
|
this.init && this.init(); |
|
|
|