ui: Close feedback widget with escape key.

It's a bit dangerous for the user to hit escape
to close the feedback widget, since it can
disappear suddenly, but users will try it, and
we should just close the widget.

(Hitting escape should be a noop if the box
is closed, but now it goes to "All Messages".)
This commit is contained in:
Steve Howell 2018-12-21 15:18:08 +00:00 committed by Tim Abbott
parent 1cbcb06157
commit bdd7a64d19
2 changed files with 9 additions and 0 deletions

View File

@ -105,6 +105,10 @@ function set_up_handlers() {
}); });
} }
exports.is_open = function () {
return meta.opened;
};
exports.dismiss = function () { exports.dismiss = function () {
animate.fadeOut(); animate.fadeOut();
}; };

View File

@ -189,6 +189,11 @@ exports.process_escape_key = function (e) {
return false; return false;
} }
if (feedback_widget.is_open()) {
feedback_widget.dismiss();
return true;
}
if (overlays.is_modal_open()) { if (overlays.is_modal_open()) {
overlays.close_active_modal(); overlays.close_active_modal();
return true; return true;