filtereditor.js: Only handle top-level containers

This commit is contained in:
Johannes Meyer 2022-02-07 14:14:10 +01:00
parent 67da4ea757
commit b03966c354
1 changed files with 12 additions and 2 deletions

View File

@ -15,13 +15,18 @@
function FilterEditor(icinga) {
Icinga.EventListener.call(this, icinga);
this.on('beforerender', this.beforeRender, this);
this.on('rendered', this.onRendered, this);
this.on('beforerender', '#main > .container', this.beforeRender, this);
this.on('rendered', '#main > .container', this.onRendered, this);
}
FilterEditor.prototype = new Icinga.EventListener();
FilterEditor.prototype.beforeRender = function(event) {
if (event.currentTarget !== event.target) {
// Nested containers are ignored
return;
}
var $container = $(event.target);
var match = containerId.exec($container.attr('id'));
@ -39,6 +44,11 @@
};
FilterEditor.prototype.onRendered = function(event) {
if (event.currentTarget !== event.target) {
// Nested containers are ignored
return;
}
var $container = $(event.target);
var match = containerId.exec($container.attr('id'));