// 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() {