hotkeys: Fix modal and overlay hiding on user settings.

Fixes #4811
This commit is contained in:
Cynthia Lin
2017-08-28 09:45:15 -07:00
committed by Tim Abbott
parent 94447a0fc4
commit 1a0a29c41d

View File

@@ -160,6 +160,10 @@ exports.is_editing_stream_name = function (e) {
return $(e.target).is(".editable-section"); return $(e.target).is(".editable-section");
}; };
exports.is_modal_open = function () {
return $(".modal").hasClass("in");
};
// Returns true if we handled it, false if the browser should. // Returns true if we handled it, false if the browser should.
exports.process_escape_key = function (e) { exports.process_escape_key = function (e) {
var row; var row;
@@ -168,6 +172,11 @@ exports.process_escape_key = function (e) {
return false; return false;
} }
if (exports.is_modal_open()) {
$(".modal").modal("hide").attr("aria-hidden", false);
return true;
}
if (overlays.is_active()) { if (overlays.is_active()) {
overlays.close_active(); overlays.close_active();
return true; return true;