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

Author: Lars Michelsen <[email protected]>
Date:   Fri Dec  3 11:13:58 2010 +0100

Additional changes to fix hidden hover menus

---

 share/frontend/nagvis-js/js/frontendHover.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/share/frontend/nagvis-js/js/frontendHover.js 
b/share/frontend/nagvis-js/js/frontendHover.js
index 27cf324..7c2f372 100644
--- a/share/frontend/nagvis-js/js/frontendHover.js
+++ b/share/frontend/nagvis-js/js/frontendHover.js
@@ -136,7 +136,7 @@ function hoverShow(x, y, id) {
        // And if the hover menu is still not on the screen move it to the left 
edge
        // and fill the whole screen width
        if(!hoverMenuInScreen(hoverMenu, hoverSpacer)) {
-               hoverMenu.style.left = hoverSpacer + 'px';
+               hoverMenu.style.left = hoverSpacer + scrollLeft + 'px';
                hoverMenu.style.width = pageWidth() - (2*hoverSpacer) + 'px';
        }
 
@@ -156,13 +156,16 @@ function hoverShow(x, y, id) {
 
 function hoverMenuInScreen(hoverMenu, hoverSpacer) {
        var hoverLeft = parseInt(hoverMenu.style.left.replace('px', ''));
+       var scrollLeft = document.body.scrollLeft ? document.body.scrollLeft :
+       document.documentElement.scrollLeft;
 
-       if(hoverLeft + hoverMenu.clientWidth >= pageWidth())
+       if(hoverLeft + hoverMenu.clientWidth >= pageWidth() - scrollLeft)
                return false;
 
        if(hoverLeft - hoverSpacer < 0)
                return false;
 
+       scrollLeft = null;
        hoverLeft = null;
        hoverMenu = null;
        return true;


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to