emposha/FCBKcomplete — Issue #114: Add "remove all items" functionality
Author: Tymotey
Created: 2012-01-19 08:45:51+00:00
State: open

After line: $(element).bind("removeItem", function(event, data) {
add this:
//public method to add remove all items
$(element).bind("removeAllItems", function(event, data) {
removeAllItems();
});

After function: function removeItem(item) {
add this:
function removeAllItems() { $("ul.holder li.bit-box").each(function(){ if($(this).attr("id")!="to_annoninput"){ removeItem($(this)); } }); }

Triggering: $(element).trigger("removeAllItems");