From 5fb22e9dc3ed49878a980a7d04f4bf009924543a Mon Sep 17 00:00:00 2001 From: pines Date: Fri, 25 Aug 2006 17:34:56 +0000 Subject: [PATCH] check out focus and set deck focus 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 | 2 ++ Open-ILS/xul/staff_client/server/circ/checkout.js | 3 ++- Open-ILS/xul/staff_client/server/circ/checkout.xul | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/deck.js b/Open-ILS/xul/staff_client/chrome/content/util/deck.js index 7d75f7cdae..3a8f734645 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/deck.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/deck.js @@ -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'); } diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 60653c7f04..1e980b7d4d 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -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(); diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.xul b/Open-ILS/xul/staff_client/server/circ/checkout.xul index 4080b9e69d..3394e0e55f 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkout.xul @@ -62,11 +62,20 @@ } 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() { -- 2.11.0