Merge pull request #546 from QuickJack/master
authorMiguel de Icaza <miguel@gnome.org>
Sat, 9 Feb 2013 20:32:50 +0000 (12:32 -0800)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 9 Feb 2013 20:32:50 +0000 (12:32 -0800)
Fixes a problem in Mono's ASP.NET Menu Control

mcs/class/System.Web/System.Web.UI.WebControls/Menu.js

index b1473d7fc1875bf0aa3501d3325a18c377a1876c..574d9ac3cb08d716b0828f488a2c15094f8d97c2 100644 (file)
@@ -1,4 +1,3 @@
-
 function Menu_OverItem (menuId, itemId, parentId) {
        var menu = getMenu (menuId);
        if (menu == null)
@@ -177,8 +176,8 @@ function Menu_Resize (subm, menuId, itemId)
         */
        var newWidth = box.offsetWidth;
        
-       if (bottom > parent.clientHeight /* && parent.scrollHeight > parent.clientHeight*/) {
-               var overflow = bottom - parent.clientHeight;
+       if (bottom > window.innerHeight) {
+               var overflow = bottom - window.innerHeight;
                var freeTop = subm.offsetTop - parent.scrollTop;
                if (overflow <= freeTop) {
                        subm.style.top = (subm.offsetTop - overflow) + "px";
@@ -186,7 +185,7 @@ function Menu_Resize (subm, menuId, itemId)
                        box.style.height = subm.initialContentHeight + "px";
                } else {
                        subm.style.top = (subm.offsetTop - freeTop) + "px";
-                       var bh = (parent.clientHeight - subm.offsetTop + parent.scrollTop) - subm.scrollButtonsHeight;
+                       var bh = (window.innerHeight - subm.offsetTop + parent.scrollTop) - subm.scrollButtonsHeight;
                        box.style.overflow = "hidden";
                        box.style.height = bh + "px";
                        displayScroll = "block";