JS: Support actiontable behavior for action-table too

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-28 17:27:33 +02:00
parent ed63d169ef
commit 301b0a8cc9

View File

@ -330,7 +330,7 @@
this.loading = false; this.loading = false;
this.on('rendered', this.onRendered, this); this.on('rendered', this.onRendered, this);
this.on('click', 'table.action tr[href]', this.onRowClicked, this); this.on('click', 'table.action tr[href], table.action-table tr[href]', this.onRowClicked, this);
}; };
ActionTable.prototype = new Icinga.EventListener(); ActionTable.prototype = new Icinga.EventListener();
@ -342,9 +342,9 @@
*/ */
ActionTable.prototype.tables = function(context) { ActionTable.prototype.tables = function(context) {
if (context) { if (context) {
return $(context).find('table.action'); return $(context).find('table.action, table.action-table');
} }
return $('table.action'); return $('table.action, table.action-table');
}; };
/** /**
@ -354,7 +354,7 @@
var self = event.data.self; var self = event.data.self;
var $target = $(event.target); var $target = $(event.target);
var $tr = $target.closest('tr'); var $tr = $target.closest('tr');
var table = new Selection($tr.closest('table.action')[0], self.icinga); var table = new Selection($tr.closest('table.action, table.action-table')[0], self.icinga);
// some rows may contain form actions that trigger a different action, pass those through // some rows may contain form actions that trigger a different action, pass those through
if (!$target.hasClass('rowaction') && $target.closest('form').length && if (!$target.hasClass('rowaction') && $target.closest('form').length &&
@ -417,7 +417,7 @@
var self = evt.data.self; var self = evt.data.self;
// initialize all rows with the correct link // initialize all rows with the correct link
$('table.action tr', container).each(function(idx, el) { $('table.action tr, table.action tr', container).each(function(idx, el) {
var $a = $('a[href].rowaction', el).first(); var $a = $('a[href].rowaction', el).first();
if ($a.length) { if ($a.length) {
// TODO: Find out whether we leak memory on IE with this: // TODO: Find out whether we leak memory on IE with this:
@ -431,7 +431,7 @@
}); });
// IE will not ignore user-select unless we cancel selectstart // IE will not ignore user-select unless we cancel selectstart
$('table.action.multiselect tr', container).each(function(idx, el) { $('table.action.multiselect tr, table.action-table.multiselect tr', container).each(function(idx, el) {
$(el).on('selectstart', false); $(el).on('selectstart', false);
}); });