Author:   Lars Michelsen <[email protected]>
Date:     Wed Apr 20 13:48:28 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Wed Apr 20 13:48:28 2011 +0200

IE rendering fixes

---

 share/frontend/nagvis-js/js/NagVisObject.js |    6 ++--
 share/frontend/nagvis-js/js/frontend.js     |    2 +-
 share/frontend/nagvis-js/js/nagvis.js       |   48 +++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index 847aa6b..416f027 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -499,20 +499,20 @@ var NagVisObject = Base.extend({
                if(xParent == yParent) {
                        var o = getMapObjByDomObjId(xParent);
                        // Don't remove when another coord is a child of this 
object
-                       if(o && 
Object.keys(this.getRelativeCoordsUsingParent(xParent)).length == 1) {
+                       if(o && 
getKeys(this.getRelativeCoordsUsingParent(xParent)).length == 1) {
                            o.delChild(this);
                            o = null
                        }
                } else {
                        var o = getMapObjByDomObjId(xParent);
                        // Don't remove when another coord is a child of this 
object
-                       if(o && 
Object.keys(this.getRelativeCoordsUsingParent(xParent)).length == 1) {
+                       if(o && 
getKeys(this.getRelativeCoordsUsingParent(xParent)).length == 1) {
                            o.delChild(this);
                            o = null
                        }
                        var o = getMapObjByDomObjId(yParent);
                        // Don't remove when another coord is a child of this 
object
-                       if(o && 
Object.keys(this.getRelativeCoordsUsingParent(yParent)).length == 1) {
+                       if(o && 
getKeys(this.getRelativeCoordsUsingParent(yParent)).length == 1) {
                            o.delChild(this);
                            o = null
                        }
diff --git a/share/frontend/nagvis-js/js/frontend.js 
b/share/frontend/nagvis-js/js/frontend.js
index 0c02615..3b2fd04 100644
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -1619,7 +1619,7 @@ function parseMap(iMapCfgAge, type, mapName) {
        // Only perform the reparsing actions when all information are there
        if(oPageProperties && oObjects) {
                // Remove all old objects
-               var keys = Object.keys(oMapObjects);
+               var keys = getKeys(oMapObjects);
                for(var i = 0, len = keys.length; i < len; i++) {
                    var obj = oMapObjects[keys[i]];
                        if(obj && typeof obj.remove === 'function') {
diff --git a/share/frontend/nagvis-js/js/nagvis.js 
b/share/frontend/nagvis-js/js/nagvis.js
index d7df3c1..225d93d 100644
--- a/share/frontend/nagvis-js/js/nagvis.js
+++ b/share/frontend/nagvis-js/js/nagvis.js
@@ -1060,6 +1060,54 @@ function isRelativeCoord(v) {
   return !isInt(v) || v.length === 6;
 }
 
+function getKeys(o) {
+    var a = [];
+    for(var key in o)
+       a.push(key);
+    return a;
+}
+
+// Is missing in some browser, e.g. IE
+// Taken from Mozilla's (ECMA-262)
+// 
(https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf)
+if (!Array.prototype.indexOf) {
+  Array.prototype.indexOf = function(searchElement /*, fromIndex */) {
+    "use strict";
+    if (this === void 0 || this === null)
+      throw new TypeError();
+
+    var t = Object(this);
+    var len = t.length >>> 0;
+    if (len === 0)
+      return -1;
+
+    var n = 0;
+    if (arguments.length > 0)
+    {
+      n = Number(arguments[1]);
+      if (n !== n)
+        n = 0;
+      else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0))
+        n = (n > 0 || -1) * Math.floor(Math.abs(n));
+    }
+
+    if (n >= len)
+      return -1;
+
+    var k = n >= 0
+          ? n
+          : Math.max(len - Math.abs(n), 0);
+
+    for (; k < len; k++)
+    {
+      if (k in t && t[k] === searchElement)
+        return k;
+    }
+    return -1;
+  };
+
+}
+
 
 /**
  * Hack to scale elements which should fill 100% of the windows viewport. The


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to