Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

"success" callback should only be called once

  • Loading branch information...
commit fc38852460cbc0edcabddeddf23867e34519603b 1 parent 811669e
@fredwu fredwu authored
View
4 lib/ajax-chosen.js
@@ -105,8 +105,8 @@
select.data().chosen.no_results_clear();
select.data().chosen.no_results(field.val());
}
- if (success != null) {
- success(data);
+ if (settings.success != null) {
+ settings.success(data);
}
return field.val(untrimmed_val);
};
View
2  lib/ajax-chosen.min.js
@@ -11,6 +11,6 @@ selected_values=[];select.find('option').each(function(){if($(this).not(":select
group.attr('label',element.text).appendTo(select);return $.each(element.items,function(i,element){var text,value;if(typeof element==="string"){value=i;text=element;}else{value=element.value;text=element.text;}
if($.inArray(value+"-"+text,selected_values)===-1){return $("<option />").attr('value',value).html(text).appendTo(group);}});}else{if(typeof element==="string"){value=i;text=element;}else{value=element.value;text=element.text;}
if($.inArray(value+"-"+text,selected_values)===-1){return $("<option />").attr('value',value).html(text).appendTo(select);}}});if(nbItems){select.trigger("liszt:updated");}else{select.data().chosen.no_results_clear();select.data().chosen.no_results(field.val());}
-if(success!=null){success(data);}
+if(settings.success!=null){settings.success(data);}
return field.val(untrimmed_val);};return this.timer=setTimeout(function(){if(chosenXhr){chosenXhr.abort();}
return chosenXhr=$.ajax(options);},options.afterTypeDelay);});});};})(jQuery);
View
2  src/ajax-chosen.coffee
@@ -142,7 +142,7 @@ do ($ = jQuery) ->
select.data().chosen.no_results field.val()
# Finally, call the user supplied callback (if it exists)
- success(data) if success?
+ settings.success(data) if settings.success?
# For some reason, the contents of the input field get removed once you
# call trigger above. Often, this can be very annoying (and can make some
Please sign in to comment.
Something went wrong with that request. Please try again.