Author: eallen
Date: 2008-11-01 18:25:18 -0400 (Sat, 01 Nov 2008)
New Revision: 2727
Modified:
mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Fixup javascript that ensures the grid widget mouseover popup doesn't appear past the
right side of the browser window.
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2008-11-01 18:53:36 UTC (rev 2726)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2008-11-01 22:25:18 UTC (rev 2727)
@@ -175,21 +175,15 @@
this.find_rule = function() {
if (document.styleSheets) {
for (var i=0; i<document.styleSheets.length; i++) {
- sheet = document.styleSheets[i];
+ var sheet = document.styleSheets[i];
if (sheet.href.indexOf("cumin.css") != -1) {
- rules = sheet.rules ? sheet.rules : sheet.cssRules;
- if (rules[0].selectorText) { // IE
+ if (sheet.cssRules) {
+ var rules = sheet.cssRules;
for (var j=0; j<rules.length; j++) {
- if (rules[j].selectorText == "DIV.sticky_note") {
+ if (rules[j].cssText.indexOf("div.sticky_note") != -1) {
return rules[j];
}
}
- } else {
- for (var j=0; j<rules.length; j++) {
- if (rules[j].cssText == "div.sticky_note") {
- return rules[j];
- }
- }
}
}
}
@@ -202,7 +196,7 @@
var true_left = o.offsetLeft;
while (p != null) {
- tag = p.tagName;
+ var tag = p.tagName;
if (p.clientLeft) {
if ( (tag != "TABLE") && (tag != "BODY") ) {
true_left += p.clientLeft;
@@ -220,12 +214,11 @@
var right = left + oGrid.offsetWidth;
var rule = this.find_rule();
if (rule) {
+ var wwidth = 9999;
if (window.innerWidth)
wwidth = window.innerWidth;
else if (document.documentElement)
wwidth = document.documentElement.clientWidth;
- else
- wwidth = 9999;
if (right + 310 > wwidth) {
rule.style.left = "";
rule.style.right = "50%";
Show replies by date