templates: Show Overlay of Recent Topics.

* Show an empty overlay of recent topics.
* Register click event to open recent topics.
* Launch recent topics on "t" keypress.

This is based on the draft overlay.
This commit is contained in:
Aman Agrawal
2020-04-08 17:29:56 +05:30
committed by Tim Abbott
parent 56b1b6c067
commit 9328dc8437
13 changed files with 152 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ const state = {
function is_overlay_hash(hash) {
// Hash changes within this list are overlays and should not unnarrow (etc.)
const overlay_list = ["streams", "drafts", "settings", "organization", "invite"];
const overlay_list = ["streams", "drafts", "settings", "organization", "invite", "recent_topics"];
const main_hash = hash_util.get_hash_category(hash);
return overlay_list.includes(main_hash);
@@ -122,6 +122,7 @@ function do_hashchange_normal(from_reload) {
case "#streams":
case "#organization":
case "#settings":
case "#recent_topics":
blueslip.error('overlay logic skipped for: ' + hash);
break;
}
@@ -225,6 +226,11 @@ function do_hashchange_overlay(old_hash) {
invite.launch();
return;
}
if (base === 'recent_topics') {
recent_topics.launch();
return;
}
}
function hashchanged(from_reload, e) {