Module: check_mk
Branch: master
Commit: e702711bfefc960e13afcf8aa866d596edd15d21
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e702711bfefc96…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 25 18:36:05 2012 +0100
Views: delay refresh after option dial change
This allows to faster toggle through all available options
without intervening refreshes
---
web/htdocs/js/checkmk.js | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 015a91c..212e3ee 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -738,7 +738,7 @@ function toggleRefreshFooter(s) {
// timer to the given interval. If the parameter is 0 the reload is stopped.
// When called with two parmeters the 2nd one is used as new url.
function setReload(secs, url) {
- if(typeof url === 'undefined')
+ if (typeof url === 'undefined')
url = '';
if (gReloadTimer) {
@@ -1716,7 +1716,13 @@ function view_dial_option(oDiv, viewname, option, choices) {
"&option=" + option + "&value=" + new_choice[0]);
if (option == "refresh")
setReload(new_choice[0]);
- handleReload('');
+ else {
+ if (gReloadTimer)
+ clearTimeout(gReloadTimer);
+ if (gReloadTime)
+ gReloadTimer = setTimeout("handleReload('')", 400.0);
+ }
+ // handleReload('');
}
// way ranges from -10 to 10 means centered (normal place)
function turn_dial(option, text, way) {