Module: nagvis
Branch: nagvis-1.4
Commit: 84952a08527dd5fb3f076a366ca611f328d555f4
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/nagvis;a=commit;h=84952a08527dd5fb3f076a366ca611f328d555f4

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

---

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

diff --git a/nagvis/nagvis/includes/js/frontend.js 
b/nagvis/nagvis/includes/js/frontend.js
index c579903..d3783c8 100644
--- a/nagvis/nagvis/includes/js/frontend.js
+++ b/nagvis/nagvis/includes/js/frontend.js
@@ -464,8 +464,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
@@ -480,7 +483,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