Module: check_mk
Branch: master
Commit: e1cc8381607efefdec2ec13afb8e9f181746eab6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e1cc8381607efe…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 6 14:59:54 2011 +0100
WATO host edit: Prevent javascript error when no wato_host_tags defined
---
web/htdocs/js/wato.js | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index 8d90c80..c27da5c 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -72,7 +72,14 @@ function wato_fix_visibility() {
/* First collect the current selection of all host attributes.
They are in the same table as we are */
var currentTags = [];
- var oTable = document.getElementById("wato_host_tags").childNodes[0]; /*
tbody */
+
+ var oHostTags = document.getElementById("wato_host_tags");
+ // Skip this function when no tags defined
+ if(!oHostTags)
+ return;
+
+ var oTable = oHostTags.childNodes[0]; /* tbody */
+ oHostTags = null;
for (var i in oTable.childNodes) {
var oTr = oTable.childNodes[i];
if (oTr.nodeName == 'TR') {
@@ -129,7 +136,7 @@ function wato_fix_visibility() {
}
}
- for each (var item in volatile_topics){
+ for (var item in volatile_topics){
var oTr = document.getElementById("topic_" + item);
if( hide_topics.indexOf(item) > -1 ){
oTr.style.display = "none";