From f90f51840a9992547720c6e34b087bdbb74b53f5 Mon Sep 17 00:00:00 2001 From: Franzz Date: Mon, 16 Sep 2019 16:52:18 +0200 Subject: [PATCH] minimum of 2 letters to trigger def search --- scripts/common.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/common.js b/scripts/common.js index fc65800..dd65341 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -175,6 +175,8 @@ $.prototype.addSearch = function(sSection) autoFocus: true, delay: 0, section:sSection, + minLength: 2, + classes:{'ui-autocomplete':'list-group'}, source: function(oRequest, fResponse) { var sTerm = removeDiacritics(oRequest.term); var rMatcher = new RegExp($.ui.autocomplete.escapeRegex(sTerm), 'i'); @@ -204,7 +206,10 @@ $.prototype.addSearch = function(sSection) .toggleClass('btn-primary', (asResults.length == 0)); fResponse(asResults); - } + }, + select: function(event, ui) { + return false; + } } ) .data("ui-autocomplete")._renderItem = function(ul, item) { @@ -243,8 +248,6 @@ $.prototype.addSearch = function(sSection) ) .appendTo(ul); }; - - $($(this).data("ui-autocomplete").classesElementLookup['ui-front']).addClass('list-group'); } $.prototype.appendIcon = function(sIcon, bFull) {