mirror of https://github.com/zulip/zulip.git
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:
parent
1cbcb06157
commit
bdd7a64d19
|
@ -105,6 +105,10 @@ function set_up_handlers() {
|
|||
});
|
||||
}
|
||||
|
||||
exports.is_open = function () {
|
||||
return meta.opened;
|
||||
};
|
||||
|
||||
exports.dismiss = function () {
|
||||
animate.fadeOut();
|
||||
};
|
||||
|
|
|
@ -189,6 +189,11 @@ exports.process_escape_key = function (e) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (feedback_widget.is_open()) {
|
||||
feedback_widget.dismiss();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (overlays.is_modal_open()) {
|
||||
overlays.close_active_modal();
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue