From efafcb98f5b4c8204d87c08c0b772c9e40872e1c Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Tue, 19 Feb 2013 18:30:58 -0500 Subject: [PATCH] disable Bill Patron button during use Even though the resulting window is modal, I've seen errors when trying to spam the button while waiting for that window. Signed-off-by: Jason Etheridge --- Open-ILS/xul/staff_client/server/patron/bill2.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 68421c2ec1..3dba04c8fd 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -152,6 +152,7 @@ function event_listeners() { window.bill_event_listeners.add($('bill_patron_btn'), 'command', function() { + $('bill_patron_btn').disabled = true; JSAN.use('util.window'); var win = new util.window(); var my_xulG = win.open( urls.XUL_PATRON_BILL_WIZARD, @@ -159,7 +160,11 @@ function event_listeners() { 'chrome,resizable,modal', { 'patron_id' : g.patron_id } ); - if (my_xulG.xact_id) { g.funcs.push( gen_list_append_func( my_xulG.xact_id ) ); /* FIXME: do something to update summary sidebar */ } + if (my_xulG.xact_id) { + g.funcs.push( gen_list_append_func( my_xulG.xact_id ) ); + if (typeof window.xulG == 'object' && typeof window.xulG.on_money_change == 'function') window.xulG.on_money_change(); + } + $('bill_patron_btn').disabled = false; }, false ); -- 2.11.0