mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 11:33:51 +00:00
hashchange: Extract func which checks current hash is in RT.
This commit is contained in:
@@ -50,7 +50,9 @@ zrequire("common");
|
|||||||
const compose_actions = set_global("compose_actions", {});
|
const compose_actions = set_global("compose_actions", {});
|
||||||
const condense = set_global("condense", {});
|
const condense = set_global("condense", {});
|
||||||
const drafts = set_global("drafts", {});
|
const drafts = set_global("drafts", {});
|
||||||
const hashchange = set_global("hashchange", {});
|
const hashchange = set_global("hashchange", {
|
||||||
|
in_recent_topics_hash: () => false,
|
||||||
|
});
|
||||||
set_global("info_overlay", {});
|
set_global("info_overlay", {});
|
||||||
const lightbox = set_global("lightbox", {});
|
const lightbox = set_global("lightbox", {});
|
||||||
const list_util = set_global("list_util", {});
|
const list_util = set_global("list_util", {});
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ function maybe_hide_recent_topics() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.in_recent_topics_hash = function () {
|
||||||
|
return ["recent_topics", "#", ""].includes(window.location.hash);
|
||||||
|
};
|
||||||
|
|
||||||
exports.changehash = function (newhash) {
|
exports.changehash = function (newhash) {
|
||||||
if (changing_hash) {
|
if (changing_hash) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ exports.process_hotkey = function (e, hotkey) {
|
|||||||
case "open_recent_topics":
|
case "open_recent_topics":
|
||||||
case "escape":
|
case "escape":
|
||||||
if (
|
if (
|
||||||
["#recent_topics", "#", ""].includes(window.location.hash) &&
|
hashchange.in_recent_topics_hash() &&
|
||||||
!popovers.any_active() &&
|
!popovers.any_active() &&
|
||||||
!overlays.is_active() &&
|
!overlays.is_active() &&
|
||||||
!$("#searchbox_form #search_query").is(":focus") &&
|
!$("#searchbox_form #search_query").is(":focus") &&
|
||||||
|
|||||||
Reference in New Issue
Block a user