From 68e0e117b0d3c1c39febd5508c5300e41cca8ee4 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 19 Aug 2010 15:50:21 -0500 Subject: [PATCH] fix bad height calculations in admin bar --- lib/WebGUI/Admin.pm | 20 ++++++++++---------- www/extras/admin/admin.js | 21 ++++++++++++++------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/lib/WebGUI/Admin.pm b/lib/WebGUI/Admin.pm index 88591593c..8c0430e6f 100644 --- a/lib/WebGUI/Admin.pm +++ b/lib/WebGUI/Admin.pm @@ -520,7 +520,7 @@ sub www_view { __DATA__
^International("admin console","AdminConsole");
-
+
  • );"> @@ -528,32 +528,32 @@ __DATA__
-
+
^International('version tags','VersionTag');
-
+
-
+
^International('1082','Asset');
-
+
-
+
^International('asset helpers','WebGUI');
-
+

^International('history','Asset');

-
+
^International('1083','Macro_AdminBar');
-
+
@@ -568,7 +568,7 @@ __DATA__
- +
diff --git a/www/extras/admin/admin.js b/www/extras/admin/admin.js index 0c830e408..f0f8c4d11 100644 --- a/www/extras/admin/admin.js +++ b/www/extras/admin/admin.js @@ -1619,10 +1619,6 @@ WebGUI.Admin.AdminBar this.addClickHandler( dt, dd ); } - // Precalculate dtHeight and maxHeight - this.dtHeight = WebGUI.Admin.getRealHeight( this.dt[0] ) * this.dt.length; - this.maxHeight = YAHOO.util.Dom.getViewportHeight() - this.dtHeight; - // Add custom event when showing an AdminBar pane this.afterShow = new YAHOO.util.CustomEvent("afterShow", this); }; @@ -1655,19 +1651,30 @@ WebGUI.Admin.AdminBar.prototype.getAnim */ WebGUI.Admin.AdminBar.prototype.getExpandHeight = function ( elem ) { + var maxHeight = this.getMaxHeight(); if ( this.cfg.expandMax ) { - return this.maxHeight; + return maxHeight; } var height = WebGUI.Admin.getRealHeight( elem ); // Make sure not more than maxHeight - if ( height > this.maxHeight ) { - return this.maxHeight; + if ( height > maxHeight ) { + return maxHeight; } return height; }; +/** + * getMaxHeight( ) + * Get the maximum possible height for the DD + */ +WebGUI.Admin.AdminBar.prototype.getMaxHeight += function () { + var dtHeight = WebGUI.Admin.getRealHeight( this.dt[0] ) * this.dt.length; + return WebGUI.Admin.getRealHeight( this.dl.parentNode ) - dtHeight; +}; + /** * show( id ) * Show the pane with the given ID. The ID is from the DT element.