Author:   Lars Michelsen <[email protected]>
Date:     Sun Apr 17 12:47:11 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sun Apr 17 12:47:11 2011 +0200

Making relative line coords to absolute coords when both nodes of a line were 
attached to the same object

---

 share/frontend/nagvis-js/js/NagVisObject.js |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index 62815cf..91863ba 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -489,10 +489,25 @@ var NagVisObject = Base.extend({
                var yParent = this.getCoordParent(this.conf.y, num);
 
                if(xParent == yParent) {
-                       getMapObjByDomObjId(xParent).delChild(this);
+                       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) {
+                           o.delChild(this);
+                           o = null
+                       }
                } else {
-                       getMapObjByDomObjId(xParent).delChild(this);
-                       getMapObjByDomObjId(yParent).delChild(this);
+                       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) {
+                           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) {
+                           o.delChild(this);
+                           o = null
+                       }
                }
                xParent = null;
                yParent = null;


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