loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>
(cherry picked from commit f47e00d9d3c3bd58b5944a29c4ff5cec0357520a)

authored by

Yarden Shoham
silverwind
and committed by
Earl Warren
544e66ec 0cf30810

+3 -1
+3 -1
web_src/js/modules/fomantic/modal.js
··· 19 19 // In such case, the "Enter" key will trigger the "cancel" button instead of "ok" button, then the dialog will be closed. 20 20 // It breaks the user experience - the "Enter" key should confirm the dialog and submit the form. 21 21 // So, all "cancel" buttons without "[type]" must be marked as "type=button". 22 - $(el).find('form button.cancel:not([type])').attr('type', 'button'); 22 + for (const button of el.querySelectorAll('form button.cancel:not([type])')) { 23 + button.setAttribute('type', 'button'); 24 + } 23 25 } 24 26 } 25 27 return ret;