Module: nagvis
Branch: master
Commit: 5bb1051dd046dbbe3d7939acdc3a195061b7a45b
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/nagvis;a=commit;h=5bb1051dd046dbbe3d7939acdc3a195061b7a45b

Author: Lars Michelsen <[email protected]>
Date:   Wed Sep 23 21:21:48 2009 +0200

#119 Problem with second state change on overview page for the same object is 
fixed

---

 share/frontend/nagvis-js/js/frontend.js |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/share/frontend/nagvis-js/js/frontend.js 
b/share/frontend/nagvis-js/js/frontend.js
index 9b75263..daca06e 100755
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -467,8 +467,11 @@ function updateObjects(aMapObjectInformations, aObjs, 
sType) {
                // output could have changed since last update). Basically this 
is only
                // needed for gadgets and/or labels with [output] or [perfdata] 
macros
                if(!aObjs[intIndex].stateChanged() && 
aObjs[intIndex].outputOrPerfdataChanged()) {
-                       // Reparse object to map
-                       aObjs[intIndex].parse();
+                       // Reparse object to map (only for maps!)
+                       // No else for overview here, senseless!
+      if(sType === 'map') {
+                               aObjs[intIndex].parse();
+                       }
                }
                
                // Detect state changes and do some actions
@@ -483,7 +486,13 @@ function updateObjects(aMapObjectInformations, aObjs, 
sType) {
                        if(sType === 'map') {
                                aObjs[intIndex].parse();
                        } else if(sType === 'overview') {
-                               aObjs[intIndex].parsedObject = 
aObjs[intIndex].parsedObject.parentNode.replaceChild(aObjs[intIndex].parseOverview(),
 aObjs[intIndex].parsedObject);
+                               // Reparsing the object on index page.
+                               // replaceChild seems not to work in all cases 
so workaround it
+                               var oOld = aObjs[intIndex].parsedObject;
+                               aObjs[intIndex].parsedObject = 
aObjs[intIndex].parsedObject.parentNode.insertBefore(aObjs[intIndex].parseOverview(),
 aObjs[intIndex].parsedObject);
+                               
aObjs[intIndex].parsedObject.parentNode.removeChild(oOld);
+
+                               oOld = null;
                        }
                        
                        /**


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to