From f22d777c2c27ea9b6bb58133f3bb27fffbd5f650 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Wed, 6 Sep 2023 15:33:58 +0200 Subject: [PATCH] Fix status flow loading when modal opens [SCI-9212] --- .../javascripts/my_modules/status_flow.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/my_modules/status_flow.js b/app/assets/javascripts/my_modules/status_flow.js index 8030fc1a2..f9078b4ce 100644 --- a/app/assets/javascripts/my_modules/status_flow.js +++ b/app/assets/javascripts/my_modules/status_flow.js @@ -2,16 +2,16 @@ (function() { $('.task-sharing-and-flows').on('click', '#viewTaskFlow', function() { - $('#statusFlowModal').modal('show'); - }); - - $('#statusFlowModal').on('show.bs.modal', function() { - var $modalBody = $(this).find('.modal-body'); - animateSpinner($modalBody); - $.get($(this).data('status-flow-url'), function(result) { - animateSpinner($modalBody, false); - $modalBody.html(result.html); + $('#statusFlowModal').off('shown.bs.modal').on('shown.bs.modal', function() { + var $modalBody = $(this).find('.modal-body'); + animateSpinner($modalBody); + $.get($(this).data('status-flow-url'), function(result) { + animateSpinner($modalBody, false); + $modalBody.html(result.html); + }); }); + + $('#statusFlowModal').modal('show'); }); function checkStatusState() {