From 33f321144f678aeb386e3f97d29cbb266dea7857 Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Sun, 18 May 2014 14:25:59 +0200 Subject: [PATCH] * Allow to press the "enter" key to perform a text search --- js/functions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index dfb7a912..f31628c3 100644 --- a/js/functions.js +++ b/js/functions.js @@ -117,9 +117,13 @@ function mkChosen(options) { function accSearch(continous, event) { var lenTxtSearch = $('#txtSearch').val().length; - if ( typeof (event) != 'undefined' && (event.keyCode < 48 || (event.keyCode > 105 && event.keyCode < 123)) ) return; + if ( typeof (event) != 'undefined' + && ((event.keyCode < 48 && event.keyCode != 13) || (event.keyCode > 105 && event.keyCode < 123)) ) return; - if (lenTxtSearch < 3 && continous === 1 && lenTxtSearch > window.lastlen) return; + if (lenTxtSearch < 3 + && continous === 1 + && lenTxtSearch > window.lastlen + && event.keyCode != 13) return; window.lastlen = lenTxtSearch;