fbg13 Posted August 30, 2016 Posted August 30, 2016 As the title says, make the esc key close the modal. 1
tpr Posted August 30, 2016 Posted August 30, 2016 Which modal? And what if there are unsaved changes? 1
fbg13 Posted August 30, 2016 Author Posted August 30, 2016 14 minutes ago, tpr said: Which modal? All that have a close button. 15 minutes ago, tpr said: And what if there are unsaved changes? It should behave like the close button. 1
tpr Posted August 30, 2016 Posted August 30, 2016 Something like this could help: $(document).on('keydown', function (e) { e = e || window.event; var closeBtn = $('.ui-dialog-titlebar-close'); if (e.keyCode === 27 && closeBtn.length) { // ESC closeBtn.trigger('click'); } }); You just need to figure out the selector of the close button - I'm not sure they are all the same, but perhaps I'm wrong. In the next version of AdminOnSteroids (uploaded soon) there will be a feature to add custom JavaScript so you just need to place it there. 3
marcus Posted September 1, 2016 Posted September 1, 2016 I think we should collect these keyboard improvements, put them into a Pull Request and point them towards "core", 2.8 and 3.0. For example: One could make the Page List in Admin (both Reno and Standard, they share the same code here) way more keyboard accessible with a few lines of code. I have this prepared but originially wanted to make further improvements on links' and buttons' focus styles, but don't find the time to finish it to match my aspiration. ProcessWire's admin themes deserve an accessibility boost PS: Not just admin themes, the standard themes should lead by example as well PPS: Just saw Ryan tagged it as "ToDo", yay 6
marcus Posted September 3, 2016 Posted September 3, 2016 I kinda polluted the new ProcessWire repo on GitHub with a first pull request https://github.com/processwire/processwire/pull/1 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now