From 329b1cf96060b7229b79894d51c6a0c7e32fb95b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 8 Jul 2014 20:10:44 +0200 Subject: [PATCH] js/loader: correctly get rid of data I'm unsure whether this is a jQuery bug or not. The removeData() function has no effect unless there is a matching data attribute. Makes IMO no sense, as adding the attribute automagically adds data, so why should removing it differ. This patch makes sure that the corresponding attribute is removed too. Fixes "dashboard sometimes flickering on refresh". refs #6536 --- public/js/icinga/loader.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 4de7a32ff..7c04c6140 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -394,6 +394,9 @@ classes.push('module-' + moduleName); } else { req.$target.removeData('icingaModule'); + if (req.$target.attr('data-icinga-module')) { + req.$target.removeAttr('data-icinga-module'); + } } req.$target.attr('class', classes.join(' ')); @@ -407,6 +410,9 @@ req.$target.data('icingaRefresh', refresh); } else { req.$target.removeData('icingaRefresh'); + if (req.$target.attr('data-icinga-refresh')) { + req.$target.removeAttr('data-icinga-refresh'); + } } // Set a window identifier if the server asks us to do so