Avoid local variable name `self' in module.js

refs #10703
This commit is contained in:
Alexander A. Klimov 2016-09-01 16:30:01 +02:00
parent 56c10ffdd5
commit 4f52beb32a

View File

@ -80,16 +80,16 @@
}, },
applyHandlers: function () { applyHandlers: function () {
var self = this; var _this = this;
$.each(this.registeredHandlers, function (key, on) { $.each(this.registeredHandlers, function (key, on) {
self.bindEventHandler( _this.bindEventHandler(
on.event, on.event,
on.filter, on.filter,
on.handler on.handler
); );
}); });
self = null; _this = null;
return this; return this;
}, },
@ -98,10 +98,10 @@
* Effectively bind the given event handler * Effectively bind the given event handler
*/ */
bindEventHandler: function (event, filter, handler) { bindEventHandler: function (event, filter, handler) {
var self = this; var _this = this;
this.icinga.logger.debug('Bound ' + filter + ' .' + event + '()'); this.icinga.logger.debug('Bound ' + filter + ' .' + event + '()');
this.handlers.push([event, filter, handler]); this.handlers.push([event, filter, handler]);
$(document).on(event, filter, handler.bind(self.object)); $(document).on(event, filter, handler.bind(_this.object));
}, },
/** /**