Skip to content

Commit ff3454b

Browse files
committed
Fix selector bug:
There are cases, when this.selector is undefined. If this is Google Chrome -- it will ignore this wrong selector; If this is Mozilla Firefox - it will bind rails autocomplete to each element on the page
1 parent 0aa654c commit ff3454b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
};
2626
if (jQuery.fn.on !== undefined) {
27-
return jQuery(document).on('focus',this.selector,handler);
27+
return this.selector ? jQuery(document).on('focus',this.selector,handler) : undefined;
2828
}
2929
else {
3030
return this.live('focus',handler);

0 commit comments

Comments
 (0)