hotkeys: Close clicked gear menu with ESC.

Fixes #4200.
This commit is contained in:
Joshua Pan
2017-05-21 19:28:52 -07:00
committed by Tim Abbott
parent c40759562c
commit c78b310381
2 changed files with 15 additions and 0 deletions

View File

@@ -51,6 +51,16 @@ exports.open = function () {
$("#gear-menu").find("li:not(.invisible) a").eq(0).focus();
};
exports.is_open = function () {
return $(".dropdown").hasClass("open");
};
exports.close = function () {
if (exports.is_open()) {
$(".dropdown").removeClass("open");
}
};
return exports;
}());