Module: check_mk
Branch: master
Commit: c3a6e47df5d0a8beb0b1975088554b4d403e4fe4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c3a6e47df5d0a8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 15 14:57:54 2011 +0100
FIX: fix row highlight in status GUI on IE 7
---
ChangeLog | 2 +-
web/htdocs/js/check_mk.js | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8ebace5..7045d1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -95,7 +95,7 @@
* FIX: event/log views: reverse sorting, so that newest entries
are shown first
* FIX: fix dashboard dashlet background on IE
- * FIX: fix row highlight in status GUI on IE 8
+ * FIX: fix row highlight in status GUI on IE 7/8
* FIX: fix row highlight after status page reload
Checks & Agents:
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index 5e092fe..6e9aae2 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -51,6 +51,14 @@ if (!Array.prototype.indexOf)
};
}
+var classRegexes = {};
+
+function hasClass(obj, cls) {
+ if(!classRegexes[cls])
+ classRegexes[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
+ return obj.className.match(classRegexes[cls]);
+}
+
// This implements getElementsByClassName() for IE<9
if (!document.getElementsByClassName) {
document.getElementsByClassName = function(className, root, tagName) {
@@ -66,7 +74,7 @@ if (!document.getElementsByClassName) {
// and for others... IE7-, IE8 (quirks mode), Firefox 2-, Safari 3.1-, Opera 9-
var tagName = tagName || '*', _tags = root.getElementsByTagName(tagName),
_nodeList = [];
for (var i = 0, _tag; _tag = _tags[i++];) {
- if (this.hasClass(_tag, className)) {
+ if (hasClass(_tag, className)) {
_nodeList.push(_tag);
}
}