filtereditor.js: Only handle top-level containers
This commit is contained in:
parent
67da4ea757
commit
b03966c354
|
@ -15,13 +15,18 @@
|
||||||
function FilterEditor(icinga) {
|
function FilterEditor(icinga) {
|
||||||
Icinga.EventListener.call(this, icinga);
|
Icinga.EventListener.call(this, icinga);
|
||||||
|
|
||||||
this.on('beforerender', this.beforeRender, this);
|
this.on('beforerender', '#main > .container', this.beforeRender, this);
|
||||||
this.on('rendered', this.onRendered, this);
|
this.on('rendered', '#main > .container', this.onRendered, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
FilterEditor.prototype = new Icinga.EventListener();
|
FilterEditor.prototype = new Icinga.EventListener();
|
||||||
|
|
||||||
FilterEditor.prototype.beforeRender = function(event) {
|
FilterEditor.prototype.beforeRender = function(event) {
|
||||||
|
if (event.currentTarget !== event.target) {
|
||||||
|
// Nested containers are ignored
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var $container = $(event.target);
|
var $container = $(event.target);
|
||||||
var match = containerId.exec($container.attr('id'));
|
var match = containerId.exec($container.attr('id'));
|
||||||
|
|
||||||
|
@ -39,6 +44,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
FilterEditor.prototype.onRendered = function(event) {
|
FilterEditor.prototype.onRendered = function(event) {
|
||||||
|
if (event.currentTarget !== event.target) {
|
||||||
|
// Nested containers are ignored
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var $container = $(event.target);
|
var $container = $(event.target);
|
||||||
var match = containerId.exec($container.attr('id'));
|
var match = containerId.exec($container.attr('id'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue