);
}
+var tabEventHandler;
+var htmlClickHandler;
+
+//Disable tab by always returning to scan box when tab is pressed
+function disableTab() {
+ tabEventHandler = dojo.connect(document, "onkeyup", function(e) {
+ var code = (e.keyCode ? e.keyCode : e.which);
+ if (code == 9 ) {
+ selfckScanBox.focus();
+ }
+ });
+ //always focus back on scan box after a click, so we are always ready to scan.
+ htmlClickHandler = dojo.connect(dojo.byId('html'), "onclick", function() { selfckScanBox.focus(); });
+}
+
+//Enable tab by removing onkeyup event handler.
+function enableTab() {
+ dojo.disconnect(tabEventHandler);
+ dojo.disconnect(htmlClickHandler);
+}
+
function SelfCheckManager() {
this.cgi = new openils.CGI();
function() {
self.updateFinesSummary();
self.drawFinesPage();
+ disableTab(); //Disable tab once done
}
);
}
for(var id in linkHandlers)
dojo.connect(dojo.byId(id), 'onclick', linkHandlers[id]);
+ //Disable tab focus change to prevent errors.
+ disableTab();
if(this.cgi.param('patron')) {
openils.Util.show('oils-selfck-bottom-div');
openils.Util.show('oils-selfck-circ-tbody', 'table-row-group');
this.goToTab('checkout');
+ selfckScanBox.focus();
while(this.itemsOutTbody.childNodes[0])
this.itemsOutTbody.removeChild(this.itemsOutTbody.childNodes[0]);
openils.Util.hide('oils-selfck-circ-tbody');
this.goToTab('items_out');
+ selfckScanBox.focus();
while(this.itemsOutTbody.childNodes[0])
this.itemsOutTbody.removeChild(this.itemsOutTbody.childNodes[0]);
break;
case 'payment':
openils.Util.show('oils-selfck-payment-page');
+ enableTab();
+ dojo.byId("dijit_form_TextBox_1").focus(); //Focus on first payment field.
break;
}
}
// this.updateScanBox(...)
this.goToTab('holds');
+ selfckScanBox.focus();
this.holdTbody = dojo.byId('oils-selfck-hold-tbody');
if(!this.holdTemplate)
//get pickup library info
var pu = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_unit.retrieve'],[null,data.hold.pickup_lib()]);
-
+
if(data.status == 4) {
holdData.push({
ready : true,