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

Author: Lars Michelsen <[email protected]>
Date:   Thu Dec  2 21:07:31 2010 +0100

Additional hover menu position fixes

---

 share/frontend/nagvis-js/js/frontendHover.js |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/share/frontend/nagvis-js/js/frontendHover.js 
b/share/frontend/nagvis-js/js/frontendHover.js
index a125632..27cf324 100644
--- a/share/frontend/nagvis-js/js/frontendHover.js
+++ b/share/frontend/nagvis-js/js/frontendHover.js
@@ -121,7 +121,7 @@ function hoverShow(x, y, id) {
                if(hoverMenu.clientWidth < minWidth)
                        hoverMenu.style.left = hoverLeft - minWidth - 
hoverSpacer + 'px';
                else
-                       hoverMenu.style.left = hoverLeft - 
hoverMenu.clientWidth - hoverSpacer + 'px';
+                       hoverMenu.style.left = (hoverLeft - 
hoverMenu.clientWidth - hoverSpacer) + 'px';
 
                if(hoverMenuInScreen(hoverMenu, hoverSpacer)) {
                        hoverPosAndSizeOk = true;
@@ -135,7 +135,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(!hoverPosAndSizeOk) {
+       if(!hoverMenuInScreen(hoverMenu, hoverSpacer)) {
                hoverMenu.style.left = hoverSpacer + 'px';
                hoverMenu.style.width = pageWidth() - (2*hoverSpacer) + 'px';
        }
@@ -168,27 +168,28 @@ function hoverMenuInScreen(hoverMenu, hoverSpacer) {
        return true;
 }
 
-function tryResize(hoverMenu, hoverSpacer, minWidth, reposition) {
-       if(!isset(reposition))
+function tryResize(hoverMenu, hoverSpacer, minWidth, rightSide) {
+       if(!isset(rightSide))
                var reposition = false;
 
        var hoverLeft = parseInt(hoverMenu.style.left.replace('px', ''));
-       var overhead = hoverLeft + hoverMenu.clientWidth + hoverSpacer - 
pageWidth();
+
+       if(rightSide)
+               var overhead = hoverLeft + hoverMenu.clientWidth + hoverSpacer 
- pageWidth();
+       else
+               var overhead = hoverLeft;
        var widthAfterResize = hoverMenu.clientWidth - overhead;
 
        // If width is larger than minWidth resize it
        if(widthAfterResize > minWidth) {
-               hoverMenu.style.display = 'none';
                hoverMenu.style.width = widthAfterResize + 'px';
 
-               if(reposition) {
+               if(rightSide) {
                        if(overhead < 0)
-                               overhead *= -1;
+                               overhead *= -1
                        hoverMenu.style.left = (hoverLeft + overhead) + 'px';
                }
 
-               hoverMenu.style.display = '';
-
                return true;
        } else {
                return false;


------------------------------------------------------------------------------
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