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

Author: LaMi <[email protected]>
Date:   Wed Nov  4 19:01:41 2009 +0100

Fixed hover menu problems caused by the new popup windows in the frontend

---

 share/frontend/nagvis-js/js/popupWindow.js |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/share/frontend/nagvis-js/js/popupWindow.js 
b/share/frontend/nagvis-js/js/popupWindow.js
index 92914c3..b56726e 100644
--- a/share/frontend/nagvis-js/js/popupWindow.js
+++ b/share/frontend/nagvis-js/js/popupWindow.js
@@ -25,12 +25,10 @@
  * @author     Lars Michelsen <[email protected]>
  */
 
-var popupIE = document.all;
 var popupNN6 = document.getElementById && !document.all;
-
 var bDragging = false;
-var x, y, tx, ty;
-var dobj;
+var pwX, pwY, pwTx, pwTy;
+var dragObj = null;
 
 /**
  * movemouse()
@@ -43,8 +41,8 @@ var dobj;
  */
 function movemouse(e) {
  if(bDragging) {
-   dobj.style.left = popupNN6 ? (tx + e.clientX - x) + 'px' : (tx + 
event.clientX - x) + 'px';
-   dobj.style.top  = popupNN6 ? (ty + e.clientY - y) + 'px' : (ty + 
event.clientY - y) + 'px';
+   dragObj.style.left = popupNN6 ? (pwTx + e.clientX - pwX) + 'px' : (pwTx + 
event.clientX - pwX) + 'px';
+   dragObj.style.top  = popupNN6 ? (pwTy + e.clientY - pwY) + 'px' : (pwTy + 
event.clientY - pwY) + 'px';
         
    return false;
  }
@@ -64,14 +62,17 @@ function movemouse(e) {
 function selectmouse(e) {
        bDragging = true;
        
-       dobj = document.getElementById('popupWindow');
+       dragObj = document.getElementById('popupWindow');
+       
+       pwTx = parseInt(dragObj.style.left+0, 10);
+       pwTy = parseInt(dragObj.style.top+0, 10);
+       pwX = popupNN6 ? e.clientX : event.clientX;
+       pwY = popupNN6 ? e.clientY : event.clientY;
        
-       tx = parseInt(dobj.style.left+0, 10);
-       ty = parseInt(dobj.style.top+0, 10);
-       x = popupNN6 ? e.clientX : event.clientX;
-       y = popupNN6 ? e.clientY : event.clientY;
+       // Register the popup window handling on the body element
+       // The document.onmousemove is used by the hover menu
+       document.body.onmousemove=movemouse;
        
-       document.onmousemove=movemouse;
        return false;
 }
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to