* Allow to press the "enter" key to perform a text search

This commit is contained in:
nuxsmin
2014-05-18 14:25:59 +02:00
parent 6745378bc3
commit 33f321144f

View File

@@ -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;