emposha / FCBKcomplete

Jquery facebook like(fancy) multi-select
http://www.emposha.com
383 stars 115 forks source link

Add "remove all items" functionality #114

Open Tymotey opened 12 years ago

Tymotey commented 12 years ago

In script file add the following code:

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).has("input")){ removeItem($(this)); } }); }

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