From 253a1b749ff5e293331a32940ca271782ea25ab8 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 14 Sep 2013 22:36:27 +0200 Subject: [PATCH] Fixes dropdown menu alignment on first call Fixes #1503 --- wcfsetup/install/files/js/WCF.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 620eaffb5f..d2e0fcdba5 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -993,6 +993,13 @@ WCF.Dropdown = { * @param jQuery dropdownMenu */ setAlignment: function(dropdown, dropdownMenu) { + // force dropdown menu to be placed in the upper left corner, otherwise + // it might cause the calculations to be a bit off if the page exceeds + // the window boundaries during getDimensions() making it visible + if (!dropdownMenu.data('isInitialized')) { + dropdownMenu.data('isInitialized', true).css({ left: 0, top: 0 }); + } + // get dropdown position var $dropdownDimensions = dropdown.getDimensions('outer'); var $dropdownOffsets = dropdown.getOffsets('offset'); -- 2.20.1