From 68874b21b770e10566c82d7788333454bf6d9f41 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 13 Dec 2017 16:28:23 -0500 Subject: [PATCH] JBAS-1728 Re-focus SCKO barcode input after printing Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js index 81159d1bd3..360513e6bc 100644 --- a/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js +++ b/Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js @@ -763,25 +763,36 @@ SelfCheckManager.prototype.printList = function(which) { // reset timeout selfckResetTimer(); + function afterPrint() { + // Called after the print window is closed. + // Re-focus input box after all print actions. + setTimeout(function(){selfckScanBox.focus()}, 100); + } + switch(which) { case 'checkout': - this.printSessionReceipt(); + this.printSessionReceipt(afterPrint); break; case 'items_out': - this.printItemsOutReceipt(); + this.printItemsOutReceipt(afterPrint); break; case 'holds': - this.printHoldsReceipt(); + this.printHoldsReceipt(afterPrint); break; case 'ready': readyHolds = true; - this.printHoldsReceipt(); + this.printHoldsReceipt(afterPrint); readyHolds = false; break; case 'fines': - this.printFinesReceipt(); + this.printFinesReceipt(afterPrint); break; } + + // afterPrint() is only called as a callback when there is stuff to + // print. Call it here too to ensure it's invokded one way or the + // other. + afterPrint(); } SelfCheckManager.prototype.updateHoldsSummary = function() { -- 2.11.0