Skip to content

Commit 59e93c1

Browse files
committed
Support jQuery v3.
The selector property was removed in jQuery v3; the recommended replacement as mentioned in https://api.jquery.com/selector was used. This isn't full jQuery v3 compatibility but this will now work when using the jQuery Migrate plugin.
1 parent 0aa654c commit 59e93c1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/assets/javascripts/autocomplete-rails-uncompressed.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
(function(jQuery)
1818
{
1919
var self = null;
20-
jQuery.fn.railsAutocomplete = function() {
20+
jQuery.fn.railsAutocomplete = function(selector) {
2121
var handler = function() {
2222
if (!this.railsAutoCompleter) {
2323
this.railsAutoCompleter = new jQuery.railsAutocomplete(this);
2424
}
2525
};
2626
if (jQuery.fn.on !== undefined) {
27-
return jQuery(document).on('focus',this.selector,handler);
27+
return jQuery(document).on('focus',selector,handler);
2828
}
2929
else {
3030
return this.live('focus',handler);
@@ -189,6 +189,6 @@
189189
});
190190

191191
jQuery(document).ready(function(){
192-
jQuery('input[data-autocomplete]').railsAutocomplete();
192+
jQuery('input[data-autocomplete]').railsAutocomplete('input[data-autocomplete]');
193193
});
194194
})(jQuery);

lib/assets/javascripts/autocomplete-rails.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)