Skip to content
Snippets Groups Projects
Commit f0e96f72 authored by Elmar Ludwig's avatar Elmar Ludwig Committed by Jan-Hendrik Willms
Browse files

copy name attribute for dialog buttons, fixes #1490

Closes #1490

Merge request studip/studip!941
parent b57946d7
No related branches found
No related tags found
No related merge requests found
......@@ -34,23 +34,18 @@ function extractButtons(element) {
var cancel = $(this).is('.cancel');
var index = cancel ? 'cancel' : label;
var classes = $(this).attr('class') || '';
var name = $(this).attr('name') || '';
var disabled = $(this).is(':disabled');
classes = classes.replace(/\bbutton\b/, '').trim();
if ($(this).is('.accept,.cancel')) {
buttons[index] = {
text: label,
click: () => this.click()
};
} else {
buttons[index] = () => this.click();
}
if ($(this).is(':disabled')) {
classes = classes + ' disabled';
}
buttons[index]['class'] = classes;
buttons[index] = {
text: label,
class: classes,
name: name,
disabled: disabled,
click: () => this.click()
};
});
return buttons;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment