recent_topics: Move from overlay to a narrow-like view.

Recent Topics is no longer an overlay now, but note that it is
also not a typical messages narrow. It can reside between
an overlay and a Filter in the sense that it is dispalyed as
a typical Filter narrow but has properties of an Overlay.

Compose box is not visible in this view as it will be confusing
to many users and hence compose shortcuts have also been disabled.

Keyboard shortcuts that apply on messages have also been disabled.

The remaining shortcuts that apply to a narrow are still accessible
here.
This commit is contained in:
Aman Agrawal
2020-07-05 15:49:09 +05:30
committed by Tim Abbott
parent 9ed3e47796
commit 1eafb1d8b3
19 changed files with 210 additions and 139 deletions

View File

@@ -34,15 +34,16 @@ exports.update_dom_with_unread_counts = function (counts) {
unread_ui.animate_mention_changes(mentioned_li, counts.mentioned_message_count);
};
function deselect_top_left_corner_items() {
function remove(elem) {
elem.removeClass("active-filter active-sub-filter");
}
function remove(elem) {
elem.removeClass("active-filter active-sub-filter");
}
function deselect_top_left_corner_items() {
remove($(".top_left_all_messages"));
remove($(".top_left_private_messages"));
remove($(".top_left_starred_messages"));
remove($(".top_left_mentions"));
remove($(".top_left_recent_topics"));
}
function should_expand_pm_list(filter) {
@@ -109,4 +110,13 @@ exports.handle_narrow_deactivated = function () {
filter_li.addClass("active-filter");
};
exports.narrow_to_recent_topics = function () {
remove($(".top_left_all_messages"));
remove($(".top_left_private_messages"));
remove($(".top_left_starred_messages"));
remove($(".top_left_mentions"));
$(".top_left_recent_topics").addClass("active-filter");
pm_list.close();
};
window.top_left_corner = exports;