Adds possibility to remove dropdowns
authorMatthias Schmidt <gravatronics@live.com>
Mon, 5 Aug 2013 09:28:14 +0000 (11:28 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 5 Aug 2013 09:28:14 +0000 (11:28 +0200)
Fixes #1426

wcfsetup/install/files/js/WCF.js

index 75bca5ae7e01e48bf430c88822298855c857b60d..e05b5107a6dd7494ebaf23a8e8c367810a203570 100755 (executable)
@@ -831,6 +831,19 @@ WCF.Dropdown = {
                }
        },
        
+       /**
+        * Removes the dropdown with the given container id.
+        * 
+        * @param       string          containerID
+        */
+       removeDropdown: function(containerID) {
+               if (this._menus[containerID]) {
+                       $(this._menus[containerID]).remove();
+                       delete this._menus[containerID];
+                       delete this._dropdowns[containerID];
+               }
+       },
+       
        /**
         * Initializes a dropdown fragment which behaves like a usual dropdown
         * but is not controlled by a trigger element.