1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 18:26:32 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2024-07-28 20:47:17 +02:00
3 changed files with 2 additions and 25 deletions

View File

@@ -337,30 +337,6 @@ $('[data-ajax]').each(function() {
}
});
// Prevent accidental double submission of form
$('[data-prevent-flood] input[type=submit]').click(function(event) {
const $submitButton = $(this); // Store the button element
const $form = $submitButton.closest('form');
// Always add the disabled class for visual feedback
$submitButton.addClass('disabled');
// Submit form if it hasn't been submitted yet
if (!$form.prop('data-form-submitted')) {
$form.prop('data-form-submitted', true);
return;
}
// Prevent default submission for subsequent clicks within 5 seconds
event.preventDefault();
setTimeout(() => {
$form.prop('removeProp', 'data-form-submitted');
$submitButton.removeClass('disabled'); // Re-enable after 5 seconds
}, 5000);
});
/**
* This simply appends #preview to the action of the
* QR action when you click the Full Editor & Preview button