From 3b884712a64c4e6b15ad0d0cffed904b1501a92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Myl=C3=A8ne=20Bressan?= Date: Sat, 24 Oct 2015 23:48:21 +0200 Subject: [PATCH] Close all modals with Esc key --- js/theme_option.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/theme_option.js b/js/theme_option.js index 56e7de0..086e923 100644 --- a/js/theme_option.js +++ b/js/theme_option.js @@ -140,7 +140,10 @@ function reOrganizeTemplates() { // for nin's templating // Close new post prompt with esc key $(document).keyup(function(e) { - if (e.keyCode == 27) {$('.mini-profile .post-area').removeClass('display');} + if (e.keyCode == 27) { + $('.mini-profile .post-area').removeClass('display'); + closeModal(); + } }); function reAppendModules() { // avoid w1200 things @@ -197,4 +200,4 @@ function openModal(modal) { } } return modal; -} \ No newline at end of file +}