From bc458f6e411d8bef3348f354c2d989e8795af0f1 Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 21 Jan 2011 16:58:44 +0000 Subject: [PATCH] fix spurious unsaved data prompt with repeated use of same patron editor (only set tab lock once with patron editor, since we only unlock once upon save) git-svn-id: svn://svn.open-ils.org/ILS/trunk@19247 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/actor/user/register.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 472fec8db..ceb0e70d0 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -51,6 +51,7 @@ var dupeBarcode = false; if(!window.xulG) var xulG = null; var lock_ready = false; +var already_locked = false; function load() { staff = new openils.User().user; @@ -765,7 +766,10 @@ function attachWidgetEvents(fmcls, fmfield, widget) { 'onKeyPress', function(){ if (lock_ready && xulG && typeof xulG.lock_tab == 'function') { - xulG.lock_tab(); + if (! already_locked) { + xulG.lock_tab(); + already_locked = true; + } } } ); @@ -774,7 +778,10 @@ function attachWidgetEvents(fmcls, fmfield, widget) { 'onChange', function(){ if (lock_ready && xulG && typeof xulG.lock_tab == 'function') { - xulG.lock_tab(); + if (! already_locked) { + xulG.lock_tab(); + already_locked = true; + } } } ); @@ -1236,7 +1243,10 @@ function _uEditSave(doClone) { params: [openils.User.authtoken, patron], oncomplete: function(r) { lock_ready = false; - if (xulG && typeof xulG.unlock_tab == 'function') { xulG.unlock_tab(); } + if (xulG && typeof xulG.unlock_tab == 'function') { + xulG.unlock_tab(); + already_locked = false; + } newPatron = openils.Util.readResponse(r); if(newPatron) { uEditUpdateUserSettings(newPatron.id()); -- 2.11.0