From f2d253f508850c3f87ed7999d381ec2eeb7fa15e Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Mon, 27 Jul 2015 10:34:17 +0200 Subject: [PATCH] Assure that rows are refreshed correctly on reload Assure that all links are initialized when the selection is applied after a request. Move action table code into the actiontable behavior. refs #8623 --- public/js/icinga/behavior/actiontable.js | 14 ++++++++++++++ public/js/icinga/events.js | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/js/icinga/behavior/actiontable.js b/public/js/icinga/behavior/actiontable.js index d3df54614..6f6521314 100644 --- a/public/js/icinga/behavior/actiontable.js +++ b/public/js/icinga/behavior/actiontable.js @@ -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(); diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 000ecf103..9d4e80b15 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -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');