One more change for the dropdowns
authorLuzifr <szekely@woltlab.com>
Tue, 20 Dec 2011 13:35:25 +0000 (14:35 +0100)
committerLuzifr <szekely@woltlab.com>
Tue, 20 Dec 2011 13:35:25 +0000 (14:35 +0100)
wcfsetup/install/files/js/WCF.js

index 3844ef0259c3d0db014ea92c04c57ee720c57668..c10f04c12674f6848ec5a92c1989bf81c0ddb762 100644 (file)
@@ -810,10 +810,10 @@ WCF.Clipboard = {
                        }
                        
                        var $editor = data.items[$typeName];
-                       var $label = $('<li><span>' + $editor.label + '</span></li>').appendTo($list).click(function(event) {
-                               $(event.target).next().toggleClass('open');
-                       });
-                       var $itemList = $('<ol></ol>').appendTo($label).hide();
+                       var $label = $('<li><span>' + $editor.label + '</span></li>').appendTo($list)
+                       var $itemList = $('<ol class="dropDown"></ol>').appendTo($label);
+
+                       $label.click(function() { $itemList.toggleClass('open'); });
                        
                        // create editor items
                        for (var $itemIndex in $editor.items) {
@@ -839,7 +839,7 @@ WCF.Clipboard = {
 
        _closeLists: function() {
                $('.clipboardEditor ul ol').each(function(index, list) {
-                       $(this).hide();
+                       $(this).removeClass('open');
                });
        },