X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fautocomplete_customer.js;h=8f8771d868928efadfe8b8202854a0ba4e061c65;hb=5aec18fed79986d088e3a7ed05a9166c48d05b39;hp=3d6b426fe8e088a2e9f7ef0018dfa99f153a9b81;hpb=3d58a31ea82a69fc2b02d8239414697cc3ad7d1a;p=kivitendo-erp.git diff --git a/js/autocomplete_customer.js b/js/autocomplete_customer.js index 3d6b426fe..8f8771d86 100644 --- a/js/autocomplete_customer.js +++ b/js/autocomplete_customer.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: 'customer-vendor-picker-picked', @@ -61,7 +64,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) { @@ -85,7 +87,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(); @@ -97,7 +98,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); } } @@ -135,6 +135,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. @@ -167,7 +171,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; } });