uncheck checkboxes of hidden fields
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: bcae94d5ce4607d4a7c6394019ab348e146370ec
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bcae94d5ce4607…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jul 31 17:55:12 2012 +0200
WATO: visibility fix for attributes. uncheck checkboxes of hidden fields
---
web/htdocs/js/wato.js | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index f83c5a0..4408194 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -54,6 +54,12 @@ function wato_check_all(css_class) {
function wato_toggle_attribute(oCheckbox, attrname) {
var oEntry = document.getElementById("attr_entry_" + attrname);
var oDefault = document.getElementById("attr_default_" + attrname);
+
+ // Permanent invisible attributes do
+ // not have attr_entry / attr_default
+ if( !oEntry ){
+ return;
+ }
if (oCheckbox.checked) {
oEntry.style.display = "";
oDefault.style.display = "none";
@@ -170,6 +176,11 @@ function wato_fix_visibility() {
oTr.appendChild(oAttrDisp);
}
if ( display == "none" ) {
+ // Uncheck checkboxes of hidden fields
+ var chkbox =
oAttrDisp.parentNode.childNodes[0].childNodes[1].childNodes[0];
+ chkbox.checked = false;
+ wato_toggle_attribute(chkbox, attrname);
+
oAttrDisp.value = "0";
} else {
oAttrDisp.value = "1";