[fix #1411] user: new form ui

This commit is contained in:
simon lehericey 2018-02-21 18:32:07 +01:00
parent 5aa9a5ac6c
commit d702a0c083
11 changed files with 461 additions and 52 deletions

View file

@ -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');
});
});
});