From 7d7160816695c99e31e494cec64e86580028e0e7 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 26 Jun 2019 19:43:35 +0200 Subject: [PATCH] Add spinner to external preview --- app/assets/javascripts/protocols/external_protocols_tab.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/protocols/external_protocols_tab.js b/app/assets/javascripts/protocols/external_protocols_tab.js index 222371ebe..eebabc86c 100644 --- a/app/assets/javascripts/protocols/external_protocols_tab.js +++ b/app/assets/javascripts/protocols/external_protocols_tab.js @@ -8,15 +8,18 @@ function applyClickCallbackOnProtocolCards() { protocol_source: $(this).data('protocol-source'), protocol_id: $(this).data('show-protocol-id') }, + beforeSend: animateSpinner($('.protocol-preview-panel'), true), success: function(data) { $('.empty-preview-panel').hide(); $('.full-preview-panel').show(); $('.preview-iframe').contents().find('body').html(data.html); + animateSpinner($('.protocol-preview-panel'), false); }, error: function(_error) { // TODO: we should probably show some alert bubble $('.empty-preview-panel').show(); $('.full-preview-panel').hide(); + animateSpinner($('.protocol-preview-panel'), false); } }); e.preventDefault();