js: Accept non-jQuery nodes in method `EventListener.bind()`

This commit is contained in:
Johannes Meyer 2021-03-02 11:56:53 +01:00
parent e4ff391b1a
commit b17be671bc
1 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,11 @@
*/
EventListener.prototype.bind = function (emitter) {
var _this = this;
if (typeof emitter.jquery === 'undefined') {
emitter = $(emitter);
}
$.each(this.handlers, function(i, handler) {
_this.icinga.logger.debug('bind: ' + handler.evt + '(' + handler.cond + ')');
emitter.on(