From: phasefx Date: Mon, 17 Jan 2011 15:30:15 +0000 (+0000) Subject: get more aggressive with unsaved data prompts. onkeypress instead of onchange X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f463734787ebac79d55b88bcb10599dd4d34164a;p=evergreen%2Fbjwebb.git get more aggressive with unsaved data prompts. onkeypress instead of onchange git-svn-id: svn://svn.open-ils.org/ILS/trunk@19184 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 63673a8ec..b842033b5 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -685,6 +685,15 @@ function attachWidgetEvents(fmcls, fmfield, widget) { dojo.connect( widget.widget, + 'onKeyPress', + function(){ + if (lock_ready && xulG && typeof xulG.lock_tab == 'function') { + xulG.lock_tab(); + } + } + ); + dojo.connect( + widget.widget, 'onChange', function(){ if (lock_ready && xulG && typeof xulG.lock_tab == 'function') { @@ -693,6 +702,7 @@ function attachWidgetEvents(fmcls, fmfield, widget) { } ); + if(fmcls == 'ac') { if(fmfield == 'barcode') { dojo.connect(widget.widget, 'onChange', diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js index 5fb625c72..5e98761c0 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js @@ -33,7 +33,7 @@ function my_init() { xulG.lock(); } } - $('i_barcode').addEventListener('change',handle_lock,false); + $('i_barcode').addEventListener('keypress',handle_lock,false); $('i_barcode').addEventListener('keypress',handle_keypress,false); $('i_barcode').focus(); diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js index 5db785c66..d35f352a8 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js @@ -43,12 +43,12 @@ function my_init() { $('duedate').addEventListener('change',check_date,false); $('p_barcode').addEventListener('change',test_patron,false); - $('p_barcode').addEventListener('change',handle_lock,false); + $('p_barcode').addEventListener('keypress',handle_lock,false); $('p_barcode').addEventListener('keypress',handle_keypress,false); $('p_barcode').focus(); - $('i_barcode').addEventListener('change',handle_lock,false); + $('i_barcode').addEventListener('keypress',handle_lock,false); $('i_barcode').addEventListener('keypress',handle_keypress,false); $('enter').addEventListener('command',handle_enter,false); diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js b/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js index fc59c5a7b..ef9cfd9bd 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js @@ -31,7 +31,7 @@ function my_init() { xulG.lock(); } } - $('i_barcode').addEventListener('change',handle_lock,false); + $('i_barcode').addEventListener('keypress',handle_lock,false); $('i_barcode').addEventListener('keypress',handle_keypress,false); $('enter').addEventListener('command',handle_enter,false); $('submit').addEventListener('command',next_patron,false); diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_register.js b/Open-ILS/xul/staff_client/chrome/content/circ/offline_register.js index 2d3e1d5e6..b633e9346 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_register.js +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_register.js @@ -28,18 +28,18 @@ function my_init() { xulG.lock(); } } - $('barcode').addEventListener('change',handle_lock,false); - $('passwd').addEventListener('change',handle_lock,false); - $('ident_value').addEventListener('change',handle_lock,false); - $('first_given_name').addEventListener('change',handle_lock,false); - $('family_name').addEventListener('change',handle_lock,false); - $('dob').addEventListener('change',handle_lock,false); - $('street1').addEventListener('change',handle_lock,false); - $('street2').addEventListener('change',handle_lock,false); - $('city').addEventListener('change',handle_lock,false); - $('state').addEventListener('change',handle_lock,false); - $('country').addEventListener('change',handle_lock,false); - $('post_code').addEventListener('change',handle_lock,false); + $('barcode').addEventListener('keypress',handle_lock,false); + $('passwd').addEventListener('keypress',handle_lock,false); + $('ident_value').addEventListener('keypress',handle_lock,false); + $('first_given_name').addEventListener('keypress',handle_lock,false); + $('family_name').addEventListener('keypress',handle_lock,false); + $('dob').addEventListener('keypress',handle_lock,false); + $('street1').addEventListener('keypress',handle_lock,false); + $('street2').addEventListener('keypress',handle_lock,false); + $('city').addEventListener('keypress',handle_lock,false); + $('state').addEventListener('keypress',handle_lock,false); + $('country').addEventListener('keypress',handle_lock,false); + $('post_code').addEventListener('keypress',handle_lock,false); $('cancel').addEventListener( 'command', diff --git a/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js b/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js index fc1b28641..3824fe475 100644 --- a/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js +++ b/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js @@ -39,13 +39,13 @@ function my_init() { $('duedate').setAttribute('value',todayPlus); $('duedate').addEventListener('change',check_date,false); - $('p_barcode').addEventListener('change',handle_lock,false); + $('p_barcode').addEventListener('keypress',handle_lock,false); $('p_barcode').addEventListener('change',test_patron,false); $('p_barcode').addEventListener('keypress',handle_keypress,false); $('p_barcode').focus(); - $('i_barcode').addEventListener('change',handle_lock,false); + $('i_barcode').addEventListener('keypress',handle_lock,false); $('i_barcode').addEventListener('keypress',handle_keypress,false); $('enter').addEventListener('command',handle_enter,false); diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 5332fb7f1..7ea39483c 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -1189,6 +1189,8 @@ g.render_input = function(node,blob) { try { if (block) return; block = true; + oils_lock_page(); + function post_c(v) { try { /* FIXME - kludgy */ diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 1a352ebde..389db5098 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -487,7 +487,7 @@ function setFocusToNextTag (row, direction) { function createMARCTextbox (element,attrs) { var box = createComplexXULElement('textbox', attrs, Array.prototype.slice.apply(arguments, [2]) ); - box.addEventListener('change',function(ev) { oils_lock_page(); },false); + box.addEventListener('keypress',function(ev) { oils_lock_page(); },false); box.onkeypress = function (event) { var root_node; var node = element; diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.xul b/Open-ILS/xul/staff_client/server/cat/marcedit.xul index 7b36212c2..ab88a1f31 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.xul +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.xul @@ -28,9 +28,9 @@