Skip to content
Snippets Groups Projects
Commit 0387c043 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Autocomplete cache clearing bug fix.

parent 87529cdb
Branches
Tags instance/local/staging/20201106
No related merge requests found
/*global jQuery, window, document, console, setTimeout, clearTimeout */ /*global jQuery, window, document, console, setTimeout, clearTimeout */
/** /**
* crhallberg/autocomplete.js 0.14 * crhallberg/autocomplete.js 0.14.1
* ~ @crhallberg * ~ @crhallberg
*/ */
(function ( $ ) { (function ( $ ) {
...@@ -240,11 +240,6 @@ ...@@ -240,11 +240,6 @@
$.fn.autocomplete = function(settings) { $.fn.autocomplete = function(settings) {
if ('undefined' == typeof settings.handler) {
console.error('handler function not provided for autocomplete');
return this;
}
options = $.extend( {}, options, settings ); options = $.extend( {}, options, settings );
return this.each(function() { return this.each(function() {
...@@ -262,6 +257,9 @@ ...@@ -262,6 +257,9 @@
cache[cid] = {}; cache[cid] = {};
} }
return input; return input;
} else if ('undefined' == typeof settings.handler) {
console.error('handler function not provided for autocomplete');
return this;
} else { } else {
element = $('.autocomplete-results'); element = $('.autocomplete-results');
if (element.length == 0) { if (element.length == 0) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment