From: Alexander Ebert Date: Fri, 25 Nov 2011 14:43:09 +0000 (+0100) Subject: Maximum height is now properly calculated X-Git-Tag: 2.0.0_Beta_1~1458^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=abe2607ed1273e9402f297fb9dabd9784b65491d;p=GitHub%2FWoltLab%2FWCF.git Maximum height is now properly calculated --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 6c771c5146..1b77120545 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3397,12 +3397,27 @@ $.widget('ui.wcfDialog', { // temporarily display container this._container.show(); } + + // force content to be visible + this._content.children().each(function() { + $(this).show(); + }); // calculate dimensions var $windowDimensions = $(window).getDimensions(); var $containerDimensions = this._container.getDimensions('outer'); var $contentDimensions = this._content.getDimensions('outer'); + // calculate maximum content height + var $heightDifference = $containerDimensions.height - $contentDimensions.height; + var $maximumHeight = $windowDimensions.height - $heightDifference - 60; + this._content.css({ maxHeight: $maximumHeight + 'px' }); + + // re-caculate values if container height was previously limited + if ($maximumHeight < $contentDimensions.height) { + $containerDimensions = this._container.getDimensions('outer'); + } + // move container var $leftOffset = Math.round(($windowDimensions.width - $containerDimensions.width) / 2); var $topOffset = Math.round(($windowDimensions.height - $containerDimensions.height) / 2); @@ -3413,11 +3428,6 @@ $.widget('ui.wcfDialog', { $topOffset = $desiredTopOffset; } - // calculate maximum content height - var $heightDifference = $containerDimensions.height - $contentDimensions.height; - var $maximumHeight = $windowDimensions.height - $heightDifference - 60; - this._content.css({ maxHeight: $maximumHeight + 'px' }); - if (!this.isOpen()) { // hide container again this._container.hide();