Skip to content

Commit 91dc0d1

Browse files
author
Tomas Kirda
committed
Do not overwrite existing autocomplete, fixes #599
1 parent 14810a1 commit 91dc0d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@
952952
};
953953

954954
// Create chainable jQuery plugin:
955-
$.fn.autocomplete = $.fn.devbridgeAutocomplete = function (options, args) {
955+
$.fn.devbridgeAutocomplete = function (options, args) {
956956
var dataKey = 'autocomplete';
957957
// If function invoked without argument return
958958
// instance of the first matched element:
@@ -978,4 +978,9 @@
978978
}
979979
});
980980
};
981+
982+
// Don't overwrite if it already exists
983+
if (!$.fn.autocomplete) {
984+
$.fn.autocomplete = $.fn.devbridgeAutocomplete;
985+
}
981986
}));

0 commit comments

Comments
 (0)