Fix multi submit bug with direct upload
This commit is contained in:
parent
389760fc17
commit
35a4367114
5 changed files with 45 additions and 10 deletions
|
@ -42,4 +42,16 @@ addEventListener("direct-upload:end", function (event) {
|
|||
element = document.getElementById("direct-upload-" + id);
|
||||
|
||||
element.classList.add("direct-upload--complete");
|
||||
});
|
||||
});
|
||||
|
||||
addEventListener('load', function() {
|
||||
var submitButtons = document.querySelectorAll('form button[type=submit][data-action]');
|
||||
var hiddenInput = document.querySelector('form input[type=hidden][name=submit_action]');
|
||||
submitButtons = [].slice.call(submitButtons);
|
||||
|
||||
submitButtons.forEach(function(button) {
|
||||
button.addEventListener('click', function() {
|
||||
hiddenInput.value = button.getAttribute('data-action');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue