FIX: cleaner error handling for multiple autocomplete matchers

This commit is contained in:
Sam Saffron 2016-02-23 15:48:39 +11:00
parent 8d1da9cedd
commit 6d22354ac3
1 changed files with 7 additions and 1 deletions

View File

@ -59,7 +59,13 @@ export default function(options) {
}
if (this.length !== 1) {
alert("only supporting one matcher at the moment");
if (window.console) {
window.console.log("WARNING: passed multiple elements to $.autocomplete, skipping.");
if (window.Error) {
window.console.log((new window.Error()).stack);
}
}
return this;
}
var disabled = options && options.disabled;