From 6355d8bd88ec6eb9ee9550d013458a47d1ab9e76 Mon Sep 17 00:00:00 2001 From: Serban Mihai Date: Mon, 9 Nov 2015 21:42:34 +0200 Subject: [PATCH] add remove function added onItemRemove function with null default value, can be added via options --- dist/fastselect.standalone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 dist/fastselect.standalone.js diff --git a/dist/fastselect.standalone.js b/dist/fastselect.standalone.js old mode 100644 new mode 100755 index 660df88..7dfa88b --- a/dist/fastselect.standalone.js +++ b/dist/fastselect.standalone.js @@ -511,7 +511,8 @@ parseResponse: null, // parse server response with your handler and return processed data - function(response, fastsearchApi) onResultsCreate: null, // adjust results element - function($allResults, data, fastsearchApi) onGroupCreate: null, // adjust group element when created - function($group, groupModel, fastsearchApi) - onItemCreate: null // adjust item element when created - function($item, model, fastsearchApi) + onItemCreate: null, // adjust item element when created - function($item, model, fastsearchApi) + onItemRemove: null // removed item - function($item, model, fastsearchApi) }; $.fastsearch = Fastsearch; @@ -895,6 +896,7 @@ this.updateDomElements(); this.writeToInput(); + this.options.onItemRemove && this.options.onItemRemove.call(this.fastsearch,$choiceItem,removedModel,this.fastsearch); }, writeToInput: function() { @@ -1201,6 +1203,7 @@ parseData: null, onItemSelect: null, + onItemRemove: null, onItemCreate: null, placeholder: 'Choose option',