Skip to content

Commit

Permalink
Assure that rows are refreshed correctly on reload
Browse files Browse the repository at this point in the history
Assure that all links are initialized when the selection is applied after a request. Move action table code into the actiontable behavior.

refs #8623
  • Loading branch information
majentsch committed Jul 27, 2015
1 parent a14da1c commit f2d253f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions public/js/icinga/behavior/actiontable.js
Expand Up @@ -381,6 +381,20 @@
var container = evt.target;
var self = evt.data.self;

// Set first links href in a action table tr as row href:
$('table.action tr', container).each(function(idx, el) {
var $a = $('a[href].rowaction', el).first();
if ($a.length) {
// TODO: Find out whether we leak memory on IE with this:
$(el).attr('href', $a.attr('href'));
return;
}
$a = $('a[href]', el).first();
if ($a.length) {
$(el).attr('href', $a.attr('href'));
}
});

// draw all selections
self.tables().each(function(i, el) {
new Selection(el, self.icinga).refresh();
Expand Down
14 changes: 0 additions & 14 deletions public/js/icinga/events.js
Expand Up @@ -40,20 +40,6 @@
icinga.loader.loadUrl(url, $(el)).autorefresh = true;
});

// Set first links href in a action table tr as row href:
$('table.action tr', el).each(function(idx, el) {
var $a = $('a[href].rowaction', el).first();
if ($a.length) {
// TODO: Find out whether we leak memory on IE with this:
$(el).attr('href', $a.attr('href'));
return;
}
$a = $('a[href]', el).first();
if ($a.length) {
$(el).attr('href', $a.attr('href'));
}
});

$('td.state span.timesince').attr('title', null);

var moduleName = el.data('icingaModule');
Expand Down

0 comments on commit f2d253f

Please sign in to comment.