fbg13 Posted August 30, 2016 Share Posted August 30, 2016 As the title says, make the esc key close the modal. 1 Link to comment Share on other sites More sharing options...
adrian Posted August 30, 2016 Share Posted August 30, 2016 Maybe at job for @tpr and AdminOnSteroids? Link to comment Share on other sites More sharing options...
tpr Posted August 30, 2016 Share Posted August 30, 2016 Which modal? And what if there are unsaved changes? 1 Link to comment Share on other sites More sharing options...
fbg13 Posted August 30, 2016 Author Share 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 Link to comment Share on other sites More sharing options...
tpr Posted August 30, 2016 Share 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 Link to comment Share on other sites More sharing options...
marcus Posted September 1, 2016 Share 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 Link to comment Share on other sites More sharing options...
marcus Posted September 3, 2016 Share 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 Link to comment Share on other sites More sharing options...
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