Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Prevent download button from being clicked multiple times #433

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

pdehaan
Copy link
Contributor

@pdehaan pdehaan commented Aug 4, 2017

This seems to work locally for me, but it happens so quickly sometimes I have a hard time clicking fast enough.

Fixes #429

@@ -42,6 +42,9 @@ $(document).ready(function() {
});
$('#download-btn').click(download);
function download() {
// Disable the download button to avoid accidental double clicks.
$('#download-btn').attr('disabled', 'disabled');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can store this selector (#download-btn) in a var because it seems we try to retrieve this ID a few times
so something like this would be great :

const $downloadBtn = $('#download-btn');

@dannycoates
Copy link
Contributor

This is good enough for now. Thanks @pdehaan

@dannycoates dannycoates merged commit 44ea075 into mozilla:master Aug 4, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants