Module: check_mk
Branch: master
Commit: e479724e670e64fb6048f464e3ecd09615538cbf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e479724e670e64…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Feb 21 11:16:34 2013 +0100
FIX: stop doing snapin refreshes after they have been removed
---
ChangeLog | 1 +
web/htdocs/js/sidebar.js | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7598ac5..675abba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
* FIX: Fixed wrong localization right after a user changed its language
* FIX: Improved handling of error messages in bulk inventory
* FIX: fixed focus bug in transform valuespec class
+ * FIX: stop doing snapin refreshes after they have been removed
BI:
* FIX: fixed invalid links to hosts and services in BI tree view
diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js
index dee1f28..6e70150 100644
--- a/web/htdocs/js/sidebar.js
+++ b/web/htdocs/js/sidebar.js
@@ -546,6 +546,15 @@ function removeSnapin(id, code) {
var myparent = container.parentNode;
myparent.removeChild(container);
+ // remove this snapin from the refresh list, if it is contained
+ for (var i in refresh_snapins) {
+ var name = refresh_snapins[i][0];
+ if (id == "snapin_" + name) {
+ refresh_snapins.splice(i, 1);
+ break;
+ }
+ }
+
// reload main frame if it is just displaying the "add snapin" page
var href = escape(parent.frames[1].location);
if (href.indexOf("sidebar_add_snapin.py") > -1)
@@ -642,7 +651,7 @@ function sidebar_scheduler() {
var name = refresh_snapins[i][0];
var refresh = refresh_snapins[i][1];
var url = "sidebar_snapin.py?name=" + name;
- if(refresh_snapins[i][2] != '')
+ if (refresh_snapins[i][2] != '')
url = refresh_snapins[i][2];
if (timestamp % refresh == 0) {