Avoid local variable name `self' in eventlistener.js

refs #10703
This commit is contained in:
Alexander A. Klimov 2016-09-01 16:02:13 +02:00
parent 060a82fa4a
commit 4e2c626ae0
1 changed files with 5 additions and 5 deletions

View File

@ -41,14 +41,14 @@
* 'on' to register listeners
*/
EventListener.prototype.bind = function (emitter) {
var self = this;
var _this = this;
$.each(this.handlers, function(i, handler) {
self.icinga.logger.debug('bind: ' + handler.evt + '(' + handler.cond + ')');
_this.icinga.logger.debug('bind: ' + handler.evt + '(' + handler.cond + ')');
emitter.on(
handler.evt, handler.cond,
{
self: handler.scope || emitter,
icinga: self.icinga
icinga: _this.icinga
}, handler.fn
);
});
@ -61,9 +61,9 @@
* 'off' to un-register listeners.
*/
EventListener.prototype.unbind = function (emitter) {
var self = this;
var _this = this;
$.each(this.handlers, function(i, handler) {
self.icinga.logger.debug('unbind: ' + handler.evt + '(' + handler.cond + ')');
_this.icinga.logger.debug('unbind: ' + handler.evt + '(' + handler.cond + ')');
emitter.off(handler.evt, handler.cond, handler.fn);
});
};