js: Fix pressing escape with modals open.

Previously, if you pressed the escape key with various modals open
(keyboard shortcuts, markdown help, etc.), the modals would close but
also the compose box would close and the user would be unnarrowed.
This changes makes it so all that happens is the modal closes.

Fixes #3472.
This commit is contained in:
khantaalaman
2017-01-27 14:27:36 +05:30
committed by Tim Abbott
parent 21083278b5
commit 04591d1ce5

View File

@@ -205,6 +205,11 @@ function process_hotkey(e) {
} else if ($("#subscription_overlay").is(":visible")) {
subs.close();
return true;
} else if ($('#markdown-help').hasClass('in') ||
$('#keyboard-shortcuts').hasClass('in') ||
$('#search-operators').hasClass('in') ||
$('#invite-user').hasClass('in')) {
return false;
}
}