X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/5debedf3465f0a66af252c65b1c7b7e694fbada6..fb63efe1b63573c2ee3535cb2f9e63502dd0e848:/js/autocomplete_part.js diff --git a/js/autocomplete_part.js b/js/autocomplete_part.js index 4c0442c63..cae7f01af 100644 --- a/js/autocomplete_part.js +++ b/js/autocomplete_part.js @@ -14,6 +14,9 @@ namespace('kivi', function(k){ RIGHT: 39, PAGE_UP: 33, PAGE_DOWN: 34, + SHIFT: 16, + CTRL: 17, + ALT: 18, }; var CLASSES = { PICKED: 'partpicker-picked', @@ -90,7 +93,6 @@ namespace('kivi', function(k){ state = STATES.PICKED; last_real = $real.val(); last_dummy = $dummy.val(); - last_unverified_dummy = $dummy.val(); $real.trigger('change'); if (o.fat_set_item && item.id) { @@ -114,7 +116,6 @@ namespace('kivi', function(k){ } else if (state == STATES.UNDEFINED && $dummy.val() === '') set_item({}) else { - last_unverified_dummy = $dummy.val(); set_item({ id: last_real, name: last_dummy }) } annotate_state(); @@ -126,7 +127,6 @@ namespace('kivi', function(k){ else if (state == STATES.UNDEFINED && $dummy.val() === '') $dummy.removeClass(STATES.UNDEFINED).addClass(STATES.PICKED); else { - last_unverified_dummy = $dummy.val(); $dummy.addClass(STATES.UNDEFINED).removeClass(STATES.PICKED); } } @@ -193,6 +193,10 @@ namespace('kivi', function(k){ select: function(event, ui) { set_item(ui.item); }, + search: function(event, ui) { + if ((event.which == KEY.SHIFT) || (event.which == KEY.CTRL) || (event.which == KEY.ALT)) + event.preventDefault(); + } }); /* In case users are impatient and want to skip ahead: * Capture key events and check if it's a unique hit. @@ -226,7 +230,7 @@ namespace('kivi', function(k){ }); return false; } - } else { + } else if ((event.which != KEY.SHIFT) && (event.which != KEY.CTRL) && (event.which != KEY.ALT)) { state = STATES.UNDEFINED; } });