actiontable.js: Only handle top-level containers

This commit is contained in:
Johannes Meyer 2022-02-07 14:12:08 +01:00
parent d7d31d00ea
commit 30326dd1bb
1 changed files with 12 additions and 2 deletions

View File

@ -348,8 +348,8 @@
*/
this.loading = false;
this.on('rendered', this.onRendered, this);
this.on('beforerender', this.beforeRender, this);
this.on('rendered', '#main > .container', this.onRendered, this);
this.on('beforerender', '#main > .container', this.beforeRender, this);
this.on('click', 'table.action tr[href], table.table-row-selectable tr[href]', this.onRowClicked, this);
};
ActionTable.prototype = new Icinga.EventListener();
@ -436,6 +436,11 @@
var container = evt.target;
var _this = evt.data.self;
if (evt.currentTarget !== container) {
// Nested containers are ignored
return;
}
// initialize all rows with the correct row action
$('table.action tr, table.table-row-selectable tr', container).each(function(idx, el) {
@ -475,6 +480,11 @@
var container = evt.target;
var _this = evt.data.self;
if (evt.currentTarget !== container) {
// Nested containers are ignored
return;
}
var active = _this.tables().find('tr.active');
if (active.length) {
$(container).data('icinga-actiontable-former-href', active.attr('href'));