|
|
|
@ -32,7 +32,11 @@
|
|
|
|
|
this._constructor(config); |
|
|
|
|
}; |
|
|
|
|
BI._.extend(OB.prototype, { |
|
|
|
|
props: {}, init: null, destroyed: null, |
|
|
|
|
props: {}, |
|
|
|
|
|
|
|
|
|
init: null, |
|
|
|
|
|
|
|
|
|
destroyed: null, |
|
|
|
|
|
|
|
|
|
_constructor: function (config) { |
|
|
|
|
this._initProps(config); |
|
|
|
@ -143,7 +147,9 @@
|
|
|
|
|
this.un(eventName, proxy); |
|
|
|
|
}; |
|
|
|
|
this.on(eventName, proxy); |
|
|
|
|
}, /** |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 解除观察者绑定的指定事件 |
|
|
|
|
* @param {String} eventName 要解除绑定事件的名字 |
|
|
|
|
* @param {Function} fn 事件对应的执行函数,该参数是可选的,没有该参数时,将解除绑定所有同名字的事件 |
|
|
|
@ -166,13 +172,17 @@
|
|
|
|
|
this._getEvents()[eventName] = newFns; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, /** |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 清除观察者的所有事件绑定 |
|
|
|
|
*/ |
|
|
|
|
purgeListeners: function () { |
|
|
|
|
/* alex:清空events*/ |
|
|
|
|
this.events = {}; |
|
|
|
|
}, /** |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 触发绑定过的事件 |
|
|
|
|
* |
|
|
|
|
* @param {String} eventName 要触发的事件的名字 |
|
|
|
|