Add initial support for mobile "quick row" feature, for ordering

at least for now, ordering only, but hopefully much more soon...
This commit is contained in:
Lance Edgar 2018-07-12 22:53:29 -05:00
parent aa6e540abd
commit 68bd3047c4
10 changed files with 143 additions and 23 deletions

View file

@ -98,6 +98,7 @@ $(document).on('click', '#datasync-restart', function() {
});
// TODO: this should go away in favor of quick_row approach
// handle global keypress on product batch "row" page, for sake of scanner wedge
var product_batch_routes = [
'mobile.batch.inventory.view',
@ -134,6 +135,23 @@ $(document).on('keypress', function(event) {
});
// handle ENTER press for quick_row forms
$(document).on('keypress', function(event) {
var quick_row = $('.ui-page-active #quick_row_entry');
if (quick_row.length) {
if (quick_row.is(':focus')) {
if (event.which == 13) { // ENTER
if (quick_row.val()) {
var form = quick_row.parents('form:first');
form.submit();
return false;
}
}
}
}
});
// when numeric keypad button is clicked, update quantity accordingly
$(document).on('click', '.quantity-keypad-thingy .keypad-button', function() {
var keypad = $(this).parents('.quantity-keypad-thingy');