Fixed label dropdowns
authorAlexander Ebert <ebert@woltlab.com>
Mon, 27 May 2013 18:54:32 +0000 (20:54 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 27 May 2013 18:54:32 +0000 (20:54 +0200)
wcfsetup/install/files/js/WCF.Label.js

index c0093ab92235acf52ce027e73a82a5f7ed130cd6..d02625f96e781e383d2e50ac16573e917c23c88f 100644 (file)
@@ -177,8 +177,15 @@ WCF.Label.Chooser = Class.extend({
                        var $groupID = $group.data('groupID');
                        
                        if (!this._groups[$groupID]) {
+                               var $containerID = $group.wcfIdentify();
+                               var $dropdownMenu = WCF.Dropdown.getDropdownMenu($containerID);
+                               if ($dropdownMenu === null) {
+                                       WCF.Dropdown.initDropdown($group.find('.dropdownToggle'));
+                                       $dropdownMenu = WCF.Dropdown.getDropdownMenu($containerID);
+                               }
+                               
                                this._groups[$groupID] = $group;
-                               var $dropdownMenu = WCF.Dropdown.getDropdownMenu($group.wcfIdentify());
+                               
                                $dropdownMenu.children('li').data('groupID', $groupID).click($.proxy(this._click, this));
                                
                                if (!$group.data('forceSelection') || this._showWithoutSelection) {