}
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) {
_closeLists: function() {
$('.clipboardEditor ul ol').each(function(index, list) {
- $(this).hide();
+ $(this).removeClass('open');
});
},