mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
parent
060a82fa4a
commit
4e2c626ae0
@ -41,14 +41,14 @@
|
|||||||
* 'on' to register listeners
|
* 'on' to register listeners
|
||||||
*/
|
*/
|
||||||
EventListener.prototype.bind = function (emitter) {
|
EventListener.prototype.bind = function (emitter) {
|
||||||
var self = this;
|
var _this = this;
|
||||||
$.each(this.handlers, function(i, handler) {
|
$.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(
|
emitter.on(
|
||||||
handler.evt, handler.cond,
|
handler.evt, handler.cond,
|
||||||
{
|
{
|
||||||
self: handler.scope || emitter,
|
self: handler.scope || emitter,
|
||||||
icinga: self.icinga
|
icinga: _this.icinga
|
||||||
}, handler.fn
|
}, handler.fn
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -61,9 +61,9 @@
|
|||||||
* 'off' to un-register listeners.
|
* 'off' to un-register listeners.
|
||||||
*/
|
*/
|
||||||
EventListener.prototype.unbind = function (emitter) {
|
EventListener.prototype.unbind = function (emitter) {
|
||||||
var self = this;
|
var _this = this;
|
||||||
$.each(this.handlers, function(i, handler) {
|
$.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);
|
emitter.off(handler.evt, handler.cond, handler.fn);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user