Module: check_mk
Branch: master
Commit: 61ec11bf46665a5fa75f6cd0099996b0bce92d76
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=61ec11bf46665a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 16 16:25:00 2015 +0200
Minor cleanups
---
web/htdocs/js/checkmk.js | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 4bdd60b..3c149ae 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -950,9 +950,6 @@ function update_header_timer()
// When called with two parmeters the 2nd one is used as new url.
function set_reload(secs, url)
{
- if (typeof url === 'undefined')
- url = '';
-
if (g_reload_timer)
clearTimeout(g_reload_timer);
@@ -960,7 +957,7 @@ function set_reload(secs, url)
if (secs !== 0) {
g_reload_interval = secs;
- schedule_reload(url, parseFloat(g_reload_interval)*1000);
+ schedule_reload();
}
}
@@ -968,6 +965,12 @@ function set_reload(secs, url)
// running, this timer is terminated and replaced by the new one.
function schedule_reload(url, milisecs)
{
+ if (typeof url === 'undefined')
+ url = ''; // reload current page (or just the content)
+
+ if (typeof milisecs === 'undefined')
+ milisecs = parseFloat(g_reload_interval) * 1000; // use default reload interval
+
if (g_reload_timer)
clearTimeout(g_reload_timer);
@@ -985,7 +988,7 @@ function handle_content_reload(_unused, code) {
// Update the header time
update_header_timer();
- schedule_reload('');
+ schedule_reload();
}
function handle_content_reload_error(data, status_code)
@@ -998,7 +1001,7 @@ function handle_content_reload_error(data, status_code)
}
// Continue update after the error
- schedule_reload('');
+ schedule_reload();
}
function do_reload(url)