From: Christian Weiske Date: Tue, 29 Mar 2011 06:05:15 +0000 (+0200) Subject: work around minLength problem in jquery-ui-autocomplete X-Git-Tag: v0.98.0~100 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=407daf0bfa9cbb86078d8f5497a10c80e53963ce;p=semanticscuttle.git work around minLength problem in jquery-ui-autocomplete --- diff --git a/data/templates/editbookmark.tpl.php b/data/templates/editbookmark.tpl.php index 69d3897..1783692 100644 --- a/data/templates/editbookmark.tpl.php +++ b/data/templates/editbookmark.tpl.php @@ -154,6 +154,10 @@ jQuery(document).ready(function() { source: function(request, response) { // delegate back to autocomplete, but extract the last term + var term = extractLast(request.term); + if (term.length < this.options.minLength) { + return; + } response( /* $.ui.autocomplete.filter( @@ -162,7 +166,7 @@ jQuery(document).ready(function() { */ $.getJSON( "", - { beginsWith: extractLast(request.term) }, + { beginsWith: term }, response ) );