Revision 48623399
Von Sven Schöling vor fast 8 Jahren hinzugefügt
js/kivi.Part.js | ||
---|---|---|
274 | 274 |
TAB: 9, |
275 | 275 |
LEFT: 37, |
276 | 276 |
RIGHT: 39, |
277 |
DOWN: 40, |
|
277 | 278 |
PAGE_UP: 33, |
278 | 279 |
PAGE_DOWN: 34, |
279 | 280 |
SHIFT: 16, |
... | ... | |
284 | 285 |
PICKED: 'partpicker-picked', |
285 | 286 |
UNDEFINED: 'partpicker-undefined', |
286 | 287 |
FAT_SET_ITEM: 'partpicker_fat_set_item', |
287 |
} |
|
288 |
};
|
|
288 | 289 |
var o = $.extend({ |
289 | 290 |
limit: 20, |
290 | 291 |
delay: 50, |
... | ... | |
305 | 306 |
var $classification_id = $('#' + real_id + '_classification_id'); |
306 | 307 |
var $unit = $('#' + real_id + '_unit'); |
307 | 308 |
var $convertible_unit = $('#' + real_id + '_convertible_unit'); |
309 |
var autocomplete_open = false; |
|
308 | 310 |
var state = STATES.PICKED; |
309 | 311 |
var last_real = $real.val(); |
310 | 312 |
var last_dummy = $dummy.val(); |
... | ... | |
463 | 465 |
search: function(event, ui) { |
464 | 466 |
if ((event.which == KEY.SHIFT) || (event.which == KEY.CTRL) || (event.which == KEY.ALT)) |
465 | 467 |
event.preventDefault(); |
468 |
}, |
|
469 |
open: function() { |
|
470 |
autocomplete_open = true; |
|
471 |
}, |
|
472 |
close: function() { |
|
473 |
autocomplete_open = false; |
|
466 | 474 |
} |
467 | 475 |
}); |
468 | 476 |
/* In case users are impatient and want to skip ahead: |
... | ... | |
497 | 505 |
}); |
498 | 506 |
return false; |
499 | 507 |
} |
508 |
} else if (event.which == KEY.DOWN && !autocomplete_open) { |
|
509 |
var old_options = $dummy.autocomplete('option'); |
|
510 |
$dummy.autocomplete('option', 'minLength', 0); |
|
511 |
$dummy.autocomplete('search', $dummy.val()); |
|
512 |
$dummy.autocomplete('option', 'minLength', old_options.minLength); |
|
500 | 513 |
} else if ((event.which != KEY.SHIFT) && (event.which != KEY.CTRL) && (event.which != KEY.ALT)) { |
501 | 514 |
state = STATES.UNDEFINED; |
502 | 515 |
} |
Auch abrufbar als: Unified diff
PartPicker: Cursor down öffnet jetzt immer das autocomplete Menü