Author:   Lars Michelsen <[email protected]>
Date:     Sun Apr 17 18:01:40 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sun Apr 17 18:01:40 2011 +0200

Fixed object removal code while reparsing the map

---

 share/frontend/nagvis-js/js/ExtGenericResize.js    |    2 +-
 .../frontend/nagvis-js/js/NagVisStatefulObject.js  |    2 ++
 share/frontend/nagvis-js/js/frontend.js            |    7 ++-----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/share/frontend/nagvis-js/js/ExtGenericResize.js 
b/share/frontend/nagvis-js/js/ExtGenericResize.js
index fe8cadf..358df88 100644
--- a/share/frontend/nagvis-js/js/ExtGenericResize.js
+++ b/share/frontend/nagvis-js/js/ExtGenericResize.js
@@ -203,7 +203,7 @@ function doMove(event) {
 
 function getReal(el, type, value) {
        temp = el;
-       while ((temp != null) && (temp.tagName != "BODY")) {
+       while(isset(temp) && temp != null && temp.tagName != "BODY") {
                if(eval("temp." + type).indexOf(value) !== -1) {
                        el = temp;
                        return el;
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js 
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 8b73ac9..7658079 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -221,6 +221,8 @@ var NagVisStatefulObject = NagVisObject.extend({
                if(!this.parsedObject) {
                        this.replaceMacros();
                }
+
+               alert(printStackTrace().join('\n'));
                
                // When this is an update, remove the object first
                this.remove();
diff --git a/share/frontend/nagvis-js/js/frontend.js 
b/share/frontend/nagvis-js/js/frontend.js
index f6944d9..46c006f 100644
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -1611,11 +1611,8 @@ function parseMap(iMapCfgAge, type, mapName) {
                                if(!oMapObjects[a].bIsLocked)
                                    iNumUnlocked -= 1;
                                
-                               // Set to null in array
-                               oMapObjects[a] = null;
-                               
-                               // Remove element from map objects array
-                               oMapObjects.splice(a,1);
+                               // Remove element from object container
+                               delete oMapObjects[a];
                        } else {
                                a++;
                        }


------------------------------------------------------------------------------
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