diff --git a/tailbone/static/js/tailbone.mobile.js b/tailbone/static/js/tailbone.mobile.js index 2423c9f6..728185d7 100644 --- a/tailbone/static/js/tailbone.mobile.js +++ b/tailbone/static/js/tailbone.mobile.js @@ -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'); diff --git a/tailbone/templates/mobile/base.mako b/tailbone/templates/mobile/base.mako index 8bf656bb..10d365c8 100644 --- a/tailbone/templates/mobile/base.mako +++ b/tailbone/templates/mobile/base.mako @@ -8,9 +8,9 @@ ${h.javascript_link('https://code.jquery.com/jquery-1.12.4.min.js')} ${h.javascript_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js')} - ${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js'))} - ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js'))} - ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.receiving.js'))} + ${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js') + '?ver={}'.format(tailbone.__version__))} + ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js') + '?ver={}'.format(tailbone.__version__))} + ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.receiving.js') + '?ver={}'.format(tailbone.__version__))} ${self.extra_javascript()} ## since jquery mobile will "utterly cache" the first page which is loaded @@ -33,7 +33,7 @@ % endif ${h.stylesheet_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css')} - ${h.stylesheet_link(request.static_url('tailbone:static/css/mobile.css'))} + ${h.stylesheet_link(request.static_url('tailbone:static/css/mobile.css') + '?ver={}'.format(tailbone.__version__))} % if not request.rattail_config.production():