diff --git a/lib/assets/javascripts/autocomplete-rails-uncompressed.js b/lib/assets/javascripts/autocomplete-rails-uncompressed.js index 5b23fbf5..b2ab0286 100644 --- a/lib/assets/javascripts/autocomplete-rails-uncompressed.js +++ b/lib/assets/javascripts/autocomplete-rails-uncompressed.js @@ -47,9 +47,13 @@ jQuery(e).autocomplete({ source: function( request, response ) { + var outerThis = this; jQuery.getJSON( jQuery(e).attr('data-autocomplete'), { term: extractLast( request.term ) }, function() { + if (arguments[0].length == 0){ + jQuery(outerThis.element[0]).trigger('railsAutocomplete.noData'); + } jQuery(arguments[0]).each(function(i, el) { var obj = {}; obj[el.id] = el;