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

Author: LaMi <[email protected]>
Date:   Sat Feb 13 16:04:37 2010 +0100

Fixed clone function

---

 share/frontend/wui/js/wui.js |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index ac4391a..b3e9ebf 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -34,7 +34,7 @@ var myshape = null;
 var myshape_background = null;
 var myshapex = 0;
 var myshapey = 0;
-var objid = 0;
+var objid = -1;
 var viewType = '';
 
 /**
@@ -327,19 +327,21 @@ function get_click_pos(e) {
                }
                
                follow_mouse = false;
+               var sUrl;
                if(action_click == 'add' || action_click == 'clone') {
-                       link = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=add&map='+mapname+'&type='+objtype+'&coords='+coords+'&viewType='+viewType;
+                       sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=add&map='+mapname+'&type='+objtype+'&coords='+coords+'&viewType='+viewType;
                        
-                       if(action_click == 'add') {
-                               link += '&clone='+objid;
+                       if(action_click == 'clone' && objid !== -1) {
+                               sUrl += '&clone='+objid;
                        }
-               } else if(action_click == 'modify') {
-                       link = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&map='+mapname+'&type='+objtype+'&id='+objid+'&coords='+coords;
+               } else if(action_click == 'modify' && objid !== -1) {
+                       sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&map='+mapname+'&type='+objtype+'&id='+objid+'&coords='+coords;
                }
                
                // FIXME: Title "+get_label('properties')+"
-               popupWindow('TITLE', getSyncRequest(link, true, false));
+               popupWindow('TITLE', getSyncRequest(sUrl, true, false));
                
+               objid = -1;
                cpt_clicks = -1;
        }       
 }


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to