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

Author: Lars Michelsen <[email protected]>
Date:   Tue Apr 27 23:53:55 2010 +0200

#272 Removing all child objects like the label and the context menu from the 
map when deleting map objects

---

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

diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index c56f84d..6512c45 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -476,9 +476,18 @@ function deleteMapObject(objId) {
                        return false;
                }
                oResult = null;
-               
-               // Remove the object from the map
-               
document.getElementById('mymap').removeChild(document.getElementById(objId));
+
+               // Remove the object with all childs and other containers from 
the map
+               var oMap = document.getElementById('mymap');
+               var ids = [ objId, 'icon_'+type+'_'+id+'-context', 
'rel_label_'+type+'_'+id, 'abs_label_'+type+'_'+id ];
+               for(var i in ids) {
+                       var o = document.getElementById(ids[i])
+                       if(o) {
+                               oMap.removeChild(o);
+                               o = null;
+                       }
+               }
+               oMap = null;
                
                return true;
        } else {


------------------------------------------------------------------------------
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to