Fixed alignment to top not handling scrollTop
authorAlexander Ebert <ebert@woltlab.com>
Mon, 18 May 2015 16:25:38 +0000 (18:25 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 18 May 2015 16:25:38 +0000 (18:25 +0200)
wcfsetup/install/files/js/WoltLab/WCF/UI/Alignment.js

index 5fa4a154839c80f99b3423d469ed97af8eb318cc..cda84a8d7af83a70acfc1a9fa4c78262ca259b88 100644 (file)
@@ -223,7 +223,7 @@ define(['Core', 'Language', 'DOM/Traverse', 'DOM/Util'], function(Core, Language
                        if (align === 'top') {
                                var bodyHeight = document.body.clientHeight;
                                bottom = (bodyHeight - refOffsets.top) + verticalOffset;
-                               if (bottom + elDimensions.height > document.body.clientHeight) {
+                               if (bodyHeight - (bottom + elDimensions.height) < document.body.scrollTop) {
                                        result = false;
                                }
                        }