mirror of https://github.com/zulip/zulip.git
Have ESC zoom out topics if you're zoomed in.
This is the natural behavior that most users will probably expect. If you need to go to All Messages when topics are zoomed in, you can just hit ESC twice.
This commit is contained in:
parent
06b1aece31
commit
3a267b5cc6
|
@ -278,6 +278,11 @@ exports.process_escape_key = function (e) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (topic_zoom.is_zoomed_in()) {
|
||||||
|
topic_zoom.zoom_out();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
narrow.deactivate();
|
narrow.deactivate();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,10 @@ var exports = {};
|
||||||
|
|
||||||
var zoomed_in = false;
|
var zoomed_in = false;
|
||||||
|
|
||||||
|
exports.is_zoomed_in = function () {
|
||||||
|
return zoomed_in;
|
||||||
|
};
|
||||||
|
|
||||||
function zoom_in() {
|
function zoom_in() {
|
||||||
var stream_id = topic_list.active_stream_id();
|
var stream_id = topic_list.active_stream_id();
|
||||||
|
|
||||||
|
@ -16,7 +20,7 @@ function zoom_in() {
|
||||||
zoomed_in = true;
|
zoomed_in = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function zoom_out() {
|
exports.zoom_out = function () {
|
||||||
var stream_li = topic_list.get_stream_li();
|
var stream_li = topic_list.get_stream_li();
|
||||||
|
|
||||||
popovers.hide_all();
|
popovers.hide_all();
|
||||||
|
@ -28,7 +32,7 @@ function zoom_out() {
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomed_in = false;
|
zoomed_in = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.clear_topics = function () {
|
exports.clear_topics = function () {
|
||||||
var stream_li = topic_list.get_stream_li();
|
var stream_li = topic_list.get_stream_li();
|
||||||
|
@ -55,7 +59,7 @@ exports.initialize = function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.show-all-streams').on('click', function (e) {
|
$('.show-all-streams').on('click', function (e) {
|
||||||
zoom_out();
|
exports.zoom_out();
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
Loading…
Reference in New Issue