[open-ils-commits] r13469 - branches/rel_1_6/Open-ILS/web/opac/extras/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 25 09:28:00 EDT 2009
Author: erickson
Date: 2009-06-25 09:27:59 -0400 (Thu, 25 Jun 2009)
New Revision: 13469
Modified:
branches/rel_1_6/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
Log:
adjust the arbitrary print sleep based on the number of items that need printing. this prevents chopping of the data as it's being queued to the printer
Modified: branches/rel_1_6/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2009-06-25 13:27:51 UTC (rev 13468)
+++ branches/rel_1_6/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2009-06-25 13:27:59 UTC (rev 13469)
@@ -176,10 +176,12 @@
$('selfck-item-barcode-input').value = ''; // prevent browser caching
$('selfck-patron-login-input').value = '';
if(patron) {
- selfckPrint();
+ var numItems = selfckPrint();
+ var sleepTime = 1000;
+ if(numItems > 0) sleepTime += (numItems / 2) * 1000;
setTimeout(
function() { location.href = location.href; },
- 3500 // give the browser time to send the page to the printer
+ sleepTime // give the browser time to send the page to the printer
);
}
}
@@ -406,7 +408,12 @@
* Sets the print date and prints the page
*/
function selfckPrint() {
- for(var x in successfulItems) { // make sure we've checked out at least one item
+
+ var numItems = 0;
+ for(var x in successfulItems)
+ numItems++;
+
+ if(numItems > 0) {
hideMe($('selfck-patron-checkout-container'));
unHideMe($('selfck-print-queuing'));
appendClear($('selfck-print-date'), text(new Date().toLocaleString()));
@@ -427,8 +434,9 @@
}
}
window.print();
- return;
}
+
+ return numItems;
}
More information about the open-ils-commits
mailing list