Open Tymotey opened 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");
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");