Commit 84ee402c authored by Robert Lyon's avatar Robert Lyon

Bug 1737581: Disable copy collection button after first click

To stop user clicking the button multiple times thinking it didn't
work the first time. This is via the 'Copy' button within the
collection.

Also fix up the changing of button to 'processing ...' and showing the
spinner when copying collection/page on 'Copy page or collection' page

behatnotneeded

Change-Id: I4188abded7135f6722c679114b8299a92dfbf2aa
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 88e8a6c8
......@@ -139,7 +139,7 @@ function formStartProcessing(form, btn) {
processingStart();
var button = jQuery(btn);
if (button.length) {
button.val(get_string('processing') + ' ...');
button.text(get_string('processing') + ' ...');
// we add a hidden input field so the "disabled" button still gets to
// pass its value through
......@@ -149,7 +149,7 @@ function formStartProcessing(form, btn) {
});
button.after(node);
button.attr('disabled', true);
button.prop('disabled', true);
button.blur();
// Start the progress meter if it is enabled.
......
......@@ -110,9 +110,13 @@ jQuery(function($) {
$("#copy-view-button").on('click', function() {
// drop the collection bit from the url
var url = copyurl.replace(/collection=(.*)/, '');
$(this).text(get_string('processing') + ' ...').prop('disabled', true).blur();
processingStart();
window.location = url;
});
$("#copy-collection-button").on('click', function() {
$(this).text(get_string('processing') + ' ...').prop('disabled', true).blur();
processingStart();
window.location = copyurl;
});
......
......@@ -6,5 +6,4 @@
}
.loading-message {
margin-left: 5px;
display: none;
}
\ No newline at end of file
......@@ -55,7 +55,7 @@
<a href="{$WWWROOT}admin/" accesskey="a" class="admin-site">{str tag="administration"}</a>
</div>
{/if}
<div id="loading-box" class="loading-box" style='display:none'></div>
<div id="loading-box" class="loading-box hidden"></div>
</div>
<div class="nav-toggle-area">
{if $MAINNAV}
......
......@@ -6,5 +6,4 @@
}
.loading-message {
margin-left: 5px;
display: none;
}
\ No newline at end of file
......@@ -49,7 +49,7 @@
<img src="{$sitelogosmall}" alt="{$sitename}">
</a>
{/if}
<div id="loading-box" class="loading-box" style='display:none'></div>
<div id="loading-box" class="loading-box hidden"></div>
</div>
{if $MAINNAV}
<!-- Brand and toggle get grouped for better mobile display -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment