mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2025-02-16 11:09:44 -05:00
Close modals with escape key
This commit is contained in:
parent
dc86deb551
commit
e261eb0cdf
1 changed files with 5 additions and 0 deletions
|
@ -269,6 +269,11 @@ function showModal(templateId) {
|
|||
});
|
||||
}
|
||||
|
||||
$(document).keyup(function(e) {
|
||||
// Exit modals with esc key
|
||||
if (e.keyCode == 27) $(document).trigger("modal:exit");
|
||||
});
|
||||
|
||||
$(document).on('click', "[data-action='modal']", function(e){
|
||||
/*
|
||||
* Usage:
|
||||
|
|
Loading…
Reference in a new issue