Skip to content
Snippets Groups Projects
Commit a51ea0da authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

respect formaction attribute in combination with form attribute, fixes #2225

Closes #2225

Merge request studip/studip!1456
parent bfe439b5
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -682,8 +682,17 @@ Dialog.initialize = function() { ...@@ -682,8 +682,17 @@ Dialog.initialize = function() {
// Actual dialog handler // Actual dialog handler
function dialogHandler(event) { function dialogHandler(event) {
if (!event.isDefaultPrevented() && checkValidity(event.target)) { if (!event.isDefaultPrevented() && checkValidity(event.target)) {
var target = $(event.target).closest('[data-dialog]'); let target = $(event.target).closest('[data-dialog]');
var options = target.data().dialog; let options = target.data().dialog;
if (
target.is('form')
&& event.originalEvent.submitter
&& $(event.originalEvent.submitter).attr('formaction')
) {
target.data('formaction', $(event.originalEvent.submitter).attr('formaction'));
}
if (Dialog.fromElement(target, parseOptions(options))) { if (Dialog.fromElement(target, parseOptions(options))) {
event.preventDefault(); event.preventDefault();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment