From 9f63d10a10773ab3d3602234fe9df668ac1122f0 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Tue, 20 Feb 2018 11:05:49 -0500 Subject: [PATCH] LP#1749992 Disable payment button during payment Since the display is not refreshed until the payment finishes, it is possible to fire off a second payment by double-clicking. This commit is a simple way to disable the button while a payment is in process, then enable it again after the display refreshes. Since the 'sendPayment()' function is wrapped, we may need to move this logic up, but this being a single promise is simpler, and it solved the problem in testing. Signed-off-by: Dan Wells Signed-off-by: Jason Stephenson --- Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/circ/patron/bills.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 index bbf65956a0..fe94996c1e 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 @@ -87,7 +87,7 @@ diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js index 2c5f6e9ad5..db1e3d926d 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js @@ -299,6 +299,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, // generates payments, collects user note if needed, and sends payment // to server. function sendPayment(note) { + $scope.applyingPayment = true; var make_payments = generatePayments(); billSvc.applyPayment( $scope.payment_type, make_payments, note, $scope.check_number) @@ -311,6 +312,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, refreshDisplay(); }) + .finally(function() { $scope.applyingPayment = false; }) } function printReceipt(type, payment_ids, payments_made, note) { -- 2.11.0