on_failure
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Dec 2005 16:23:57 +0000 (16:23 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Dec 2005 16:23:57 +0000 (16:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2255 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/checkout.js

index 32794a6..fda9135 100644 (file)
@@ -175,6 +175,9 @@ circ.checkout.prototype = {
                                                        } catch(E) {
                                                                alert('FIXME: need special alert and error handling\n'
                                                                        + js2JSON(E));
+                                                               if (typeof obj.on_failure == 'function') {
+                                                                       obj.on_failure();
+                                                               }
                                                        }
                                                }
                                        ],
@@ -202,6 +205,11 @@ circ.checkout.prototype = {
        'on_checkout' : function() {
                this.controller.view.checkout_barcode_entry_textbox.value = '';
                this.controller.view.checkout_barcode_entry_textbox.focus();
+       },
+
+       'on_failure' : function() {
+               this.controller.view.checkout_barcode_entry.textbox.select();
+               this.controller.view.checkout_barcode_entry_textbox.focus();
        }
 }