Module: nagvis Branch: nagvis-1.5 Commit: 6ad213890b5d32005788af9967947587d95e6226 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=6ad213890b5d32005788af9967947587d95e6226
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 4176f61..972d0cb 100644 --- a/share/frontend/nagvis-js/js/frontendHover.js +++ b/share/frontend/nagvis-js/js/frontendHover.js @@ -123,7 +123,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; @@ -137,7 +137,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'; } @@ -170,27 +170,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
