Fixed overflow calculation for dialog overlays
authorAlexander Ebert <ebert@woltlab.com>
Mon, 29 Jul 2013 13:06:44 +0000 (15:06 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 29 Jul 2013 13:06:44 +0000 (15:06 +0200)
wcfsetup/install/files/js/WCF.js

index 8fe0c8f2ed47116ff6277b9d27af201bc1fd020d..0742818ef8aa4a085b2855031ce5ad4220a68b75 100755 (executable)
@@ -8647,6 +8647,18 @@ $.widget('ui.wcfDialog', {
                
                this._content.css('overflow', $overflow);
                this._content.css('maxHeight', $maxHeight);
+               
+               if ($overflow === 'visible') {
+                       // content may already overflow, even though the overall height is still below the threshold
+                       var $contentHeight = 0;
+                       this._content.children().each(function(index, child) {
+                               $contentHeight += $(child).outerHeight();
+                       });
+                       
+                       if (this._content.height() < $contentHeight) {
+                               this._content.css('overflow', 'auto');
+                       }
+               }
        },
        
        /**