Commit 08a3d700 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>
(cherry picked from commit 84ee402c)
parent 21866322
......@@ -137,7 +137,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
......@@ -147,7 +147,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($j) {
$j("#copy-view-button").on('click', function() {
// drop the collection bit from the url
var url = copyurl.replace(/collection=(.*)/, '');
$j(this).text(get_string('processing') + ' ...').prop('disabled', true).blur();
processingStart();
window.location = url;
});
$j("#copy-collection-button").on('click', function() {
$j(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
......@@ -64,7 +64,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>
{include file="header/topright.tpl"}
......
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