From 5b3da47ca65542ef1cc5fb8e1dd2801344743d1f Mon Sep 17 00:00:00 2001 From: Eckhard Rotte Date: Thu, 24 Aug 2017 11:03:55 +0200 Subject: [PATCH] migrate dprecated `$.isArray` to `Array.isArray` `$.isArray` is deprecated in jQuery 3.2, so Array.isArray should be the way to go. https://github.com/jquery/jquery/issues/2961 https://blog.jquery.com/2017/03/16/jquery-3-2-0-is-out/ --- src/jquery.autocomplete.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 91afcab..d93174b 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -138,7 +138,7 @@ if (!currentValue) { return suggestion.value; } - + var pattern = '(' + utils.escapeRegExChars(currentValue) + ')'; return suggestion.value @@ -237,7 +237,7 @@ that.hide(); }, 200); }, - + abortAjax: function () { var that = this; if (that.currentRequest) { @@ -252,7 +252,7 @@ this.options = $.extend({}, options, suppliedOptions); - that.isLocal = $.isArray(options.lookup); + that.isLocal = Array.isArray(options.lookup); if (that.isLocal) { options.lookup = that.verifySuggestionsFormat(options.lookup); @@ -558,7 +558,7 @@ response = that.cachedResponse[cacheKey]; } - if (response && $.isArray(response.suggestions)) { + if (response && Array.isArray(response.suggestions)) { that.suggestions = response.suggestions; that.suggest(); options.onSearchComplete.call(that.element, q, response.suggestions); @@ -704,7 +704,7 @@ noSuggestionsContainer.detach(); // clean suggestions if any - container.empty(); + container.empty(); container.append(noSuggestionsContainer); if ($.isFunction(beforeRender)) {