From: Alexander Ebert Date: Sun, 10 Feb 2013 20:28:42 +0000 (+0100) Subject: Improved visuals for dialog overlays X-Git-Tag: 2.0.0_Beta_1~493^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c1b31f6f16d665b5c42cc0e9f130c3a99d3dc184;p=GitHub%2FWoltLab%2FWCF.git Improved visuals for dialog overlays --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 2fa5f64f23..59537da552 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -7701,10 +7701,11 @@ $.widget('ui.wcfDialog', { // remove static dimensions this._content.css({ height: 'auto', - overflow: 'auto', width: 'auto' }); + this._determineOverflow(); + if (!this.isOpen()) { // hide container again this._container.hide(); @@ -7718,6 +7719,24 @@ $.widget('ui.wcfDialog', { } }, + /** + * Determines content overflow based upon static dimensions. + */ + _determineOverflow: function() { + var $max = $(window).getDimensions(); + var $maxHeight = this._content.css('maxHeight'); + this._content.css('maxHeight', 'none'); + var $dialog = this._container.getDimensions('outer'); + + var $overflow = 'visible'; + if (($max.height * 0.8 < $dialog.height) || ($max.width * 0.8 < $dialog.width)) { + $overflow = 'auto'; + } + + this._content.css('overflow', $overflow); + this._content.css('maxHeight', $maxHeight); + }, + /** * Returns calculated content dimensions. * diff --git a/wcfsetup/install/files/style/dialog.less b/wcfsetup/install/files/style/dialog.less index 7e322612b7..ab3413dda7 100644 --- a/wcfsetup/install/files/style/dialog.less +++ b/wcfsetup/install/files/style/dialog.less @@ -59,7 +59,6 @@ .dialogContent { background-color: @wcfContainerBackgroundColor; color: @wcfColor; - overflow: auto; padding: 10px 20px 20px; &:not(.dialogForm) {