From 3ef8dee94bf39df70c7330c4137bdf97a3245506 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 25 May 2013 01:50:02 +0200 Subject: [PATCH] Improved dropdown menus Attention! Dropdown menus are now moved into document's body to prevent issues with "display: overflow" set for certain elements. Please check the new API methods of WCF.Dropdown, especially the changed API signature for registered callbacks. --- wcfsetup/install/files/js/WCF.js | 347 +++++++++++++-------- wcfsetup/install/files/style/dropdown.less | 201 ++++++------ 2 files changed, 322 insertions(+), 226 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 049195baee..a20904860f 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -684,43 +684,29 @@ WCF.Dropdown = { */ _dropdowns: { }, + /** + * container for dropdown menus + * @var object + */ + _menuContainer: null, + + /** + * list of registered dropdown menus + * @var object + */ + _menus: { }, + /** * Initializes dropdowns. */ init: function() { - var $userPanelHeight = $('#topMenu').outerHeight(); + if (this._menuContainer === null) { + this._menuContainer = $('