Fixed alignment calculation of dropdowns
authorMarcel Werk <burntime@woltlab.com>
Sat, 17 Sep 2016 11:40:09 +0000 (13:40 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 17 Sep 2016 11:40:09 +0000 (13:40 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Alignment.js

index 015acc1bddc5582b01eca9f12976b970f4b93b7b..d7c07558657c391a1697b0cd18c48f22d6ff0fa7 100644 (file)
@@ -190,10 +190,15 @@ define(['Core', 'Language', 'Dom/Traverse', 'Dom/Util'], function(Core, Language
                                }
                        }
                        else if (align === 'right') {
-                               right = windowWidth - (refOffsets.left + refDimensions.width);
-                               if (right < 0) {
+                               if (refOffsets.left + refDimensions.width < elDimensions.width) {
                                        result = false;
                                }
+                               else {
+                                       right = windowWidth - (refOffsets.left + refDimensions.width);
+                                       if (right < 0) {
+                                               result = false;
+                                       }
+                               }
                        }
                        else {
                                left = refOffsets.left + (refDimensions.width / 2) - (elDimensions.width / 2);