From 73944dd4501b982a17f5f7a54474b6e2e8d01ee8 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Tue, 1 Nov 2011 14:00:46 -0400 Subject: [PATCH] When editing cards, lock tab on apply changes Hopefully to prevent people from moving away before saving. Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- Open-ILS/web/js/ui/default/actor/user/register.js | 7 +++++++ 1 file changed, 7 insertions(+) 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 a29920a87a..56b726128e 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -394,6 +394,7 @@ function drawAllCards() { function applyCardChanges() { var cardrows = dojo.query('[cardid]', allCardsDialog.domNode); + var changed = false; dojo.forEach(cardrows, function(row) { if(cardPerms['UPDATE_PATRON_ACTIVE_CARD']) { @@ -401,15 +402,21 @@ function applyCardChanges() { if(row.card.active() != active) { row.card.active(active); row.card.ischanged(1); + changed = true; } } if(cardPerms['UPDATE_PATRON_PRIMARY_CARD']) { if(row.primary_radiobutton.checked && row.card.id() != patron.card().id()) { patron.card(row.card); + changed = true; } } } ); + if(changed && lock_ready && xulG && typeof xulG.lock_tab == 'function' && !already_locked) { + xulG.lock_tab(); + already_locked = true; + } allCardsDialog.hide(); } -- 2.11.0