Module: check_mk
Branch: master
Commit: 9dd23306bb9ee55e42aa8f5780025c7a438b32b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9dd23306bb9ee5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 28 10:15:51 2013 +0200
wato: fixed layout in ruleset lists when help texts are disabled
---
web/htdocs/js/checkmk.js | 19 +++++++++++++------
web/htdocs/wato.py | 8 +++++++-
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 4926c67..b253a4c 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1763,14 +1763,21 @@ function help_switch(how) {
helpdivs[i].style.display = how ? "block" : "none";
}
- // small hack for wato ruleset lists, toggle the "nofloat" class
- // on those objects to make the layout possible
+ // small hack for wato ruleset lists, toggle the "float" and
"nofloat"
+ // classes on those objects to make the layout possible
var rulesetdivs = document.getElementsByClassName('ruleset');
for (var i = 0; i < rulesetdivs.length; i++) {
- if (how)
- add_class(rulesetdivs[i], 'nofloat');
- else
- remove_class(rulesetdivs[i], 'nofloat');
+ if (how) {
+ if (has_class(rulesetdivs[i], 'float')) {
+ remove_class(rulesetdivs[i], 'float');
+ add_class(rulesetdivs[i], 'nofloat');
+ }
+ } else {
+ if (has_class(rulesetdivs[i], 'nofloat')) {
+ remove_class(rulesetdivs[i], 'nofloat');
+ add_class(rulesetdivs[i], 'float');
+ }
+ }
}
get_url("ajax_switch_help.py?enabled=" + (how ? "yes" :
""));
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index fcb7b90..0e08f7d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10302,7 +10302,13 @@ def mode_rulesets(phase):
something_shown = True
- float_cls = (not config.wato_hide_help_in_lists and html.help_visible) and
' nofloat' or ''
+ float_cls = ''
+ if not config.wato_hide_help_in_lists:
+ if html.help_visible:
+ float_cls = ' nofloat'
+ else:
+ float_cls = ' float'
+
url_vars = [("mode", "edit_ruleset"),
("varname", varname)]
if only_host:
url_vars.append(("host", only_host))