mirror of
https://github.com/go-gitea/gitea
synced 2024-11-26 07:02:47 +01:00
Remove jQuery .attr
from the Fomantic modal cancel buttons (#30113)
- Switched from jQuery `attr` to plain javascript `setAttribute` - Tested the modals and they work as before --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
5687aca4fc
commit
f47e00d9d3
1 changed files with 3 additions and 1 deletions
|
@ -19,7 +19,9 @@ function ariaModalFn(...args) {
|
|||
// In such case, the "Enter" key will trigger the "cancel" button instead of "ok" button, then the dialog will be closed.
|
||||
// It breaks the user experience - the "Enter" key should confirm the dialog and submit the form.
|
||||
// So, all "cancel" buttons without "[type]" must be marked as "type=button".
|
||||
$(el).find('form button.cancel:not([type])').attr('type', 'button');
|
||||
for (const button of el.querySelectorAll('form button.cancel:not([type])')) {
|
||||
button.setAttribute('type', 'button');
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue