check out focus and set deck focus
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 17:34:56 +0000 (17:34 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 17:34:56 +0000 (17:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5674 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/deck.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/checkout.xul

index 7d75f7c..3a8f734 100644 (file)
@@ -47,6 +47,7 @@ util.deck.prototype = {
                                        var cw = iframe.contentWindow; 
                                        if (typeof iframe.contentWindow.wrappedJSObject != 'undefined') cw = iframe.contentWindow.wrappedJSObject;
                                        cw.IAMXUL = true; cw.xulG = content_params;
+                                       setTimeout( function() { if (typeof cw.default_focus == 'function') cw.default_focus(); }, 0 );
                                } catch(E) {
                                        this.error.sdump('D_ERROR','E: ' + E + '\n');
                                }
@@ -83,6 +84,7 @@ util.deck.prototype = {
                                if (typeof iframe.contentWindow.wrappedJSObject != 'undefined') cw = iframe.contentWindow.wrappedJSObject;
                                cw.IAMXUL = true; cw.xulG = content_params;
                                this.error.sdump('D_DECK', 'cw = ' + cw + ' cw.xulG = ' + js2JSON(cw.xulG) );
+                               setTimeout( function() { if (typeof cw.default_focus == 'function') cw.default_focus(); }, 0 );
                        } catch(E) {
                                this.error.sdump('D_ERROR','E: ' + E + '\n');
                        }
index 60653c7..1e980b7 100644 (file)
@@ -202,7 +202,8 @@ circ.checkout.prototype = {
                        }
                );
                this.controller.render();
-               this.controller.view.checkout_barcode_entry_textbox.focus();
+               //this.controller.view.checkout_barcode_entry_textbox.focus();
+               default_focus();
 
                this.check_disable();
 
index 4080b9e..3394e0e 100644 (file)
                }
 
                function default_focus() {
-                       try {
-                               document.getElementById('checkout_barcode_entry_textbox').focus();
-                       } catch(E) {
-                               g.error.sdump('D_ERROR','checkout default_focus(): ' + js2JSON(E));
-                       }
+                       setTimeout(
+                               function() {
+                                       try {
+                                               var x = document.getElementById('checkout_barcode_entry_textbox');
+                                               if (x.disabled) {
+                                                       document.getElementById('checkout_duedate_menu').inputField.focus();
+                                               } else {
+                                                x.focus();
+                                               }
+                                       } catch(E) {
+                                               g.error.sdump('D_ERROR','checkout default_focus(): ' + js2JSON(E));
+                                       }
+                               }, 0
+                       );
                }
 
                function refresh() {