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

Author: Lars Michelsen <[email protected]>
Date:   Fri Nov 19 08:50:15 2010 +0100

WUI: Fixed reposition effect when adding borders to objects while hovering over 
a line

---

 ChangeLog                             |    1 +
 share/frontend/wui/classes/WuiMap.php |    4 ++--
 share/frontend/wui/js/wui.js          |   18 +++++++++++++++++-
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a4abd58..9c6c588 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,3 +17,4 @@ Frontend
 
 WUI
     * Bugfix: Fixed deletion of multiple objects of same type in WUI without 
reloading
+    * Fixed reposition effect when adding borders to objects while hovering 
over a line
diff --git a/share/frontend/wui/classes/WuiMap.php 
b/share/frontend/wui/classes/WuiMap.php
index 440fa17..fe3ff3d 100644
--- a/share/frontend/wui/classes/WuiMap.php
+++ b/share/frontend/wui/classes/WuiMap.php
@@ -302,13 +302,13 @@ class WuiMap extends GlobalMap {
                        $y = $y1;
                }
                
-               $ret .= "var ".$lineId." = new 
jsGraphics('box_".$obj['type']."_".$obj['id']."');";
+               $ret .= "var ".$lineId." = new 
jsGraphics('line_".$obj['type']."_".$obj['id']."');";
                $ret .= $lineId.".setColor('#FF0000');";
                $ret .= $lineId.".setStroke(1);";
                $ret .= 
$lineId.".drawLine(".($x1-$x).",".($y1-$y).",".($x2-$x).",".($y2-$y).");";
                $ret .= $lineId.".paint();";
                
-               return $this->parseJs($ret);
+               return '<div style="position:absolute;top:0px;left:0px" 
id="line_'.$obj['type'].'_'.$obj['id'].'"></div>'.$this->parseJs($ret);
        }
        
        /**
diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index b4d49c0..46fcef7 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -701,16 +701,32 @@ function toggleBorder(oObj, state){
        var top = parseInt(oContainer.style.top.replace('px', ''));
        var left = parseInt(oContainer.style.left.replace('px', ''));
 
+       var parts = oObj.id.split('_');
+       var type  = parts[1];
+  var id    = parts[2];
+  var oLine = document.getElementById('line_'+type+'_'+id);
+
        if(state === 1) {
                oObj.style.border = iWidth + "px solid " + sColor;
-               oContainer.style.top = (top - iWidth) + 'px';
+               oContainer.style.top  = (top - iWidth) + 'px';
                oContainer.style.left = (left - iWidth) + 'px';
+
+               if(oLine) {
+                       oLine.style.top  = iWidth + 'px';
+                       oLine.style.left = iWidth + 'px';
+               }
        } else {
                oObj.style.border = "none";
                oContainer.style.top = (top + iWidth) + 'px';
                oContainer.style.left = (left + iWidth) + 'px';
+
+               if(oLine) {
+                       oLine.style.top  = '0px';
+                       oLine.style.left = '0px';
+               }
        }
        
+       oLine = null;
        oObj = null;
        oContainer = null;
 }


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to