Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

topic_sidebar_actions: Remove "Narrow to topic" option.

Nikhil Maske2e7aaba0dde5
diff --git a/static/js/stream_popover.js b/static/js/stream_popover.js
index f322ef703e7..e53f1ab777b 100644
--- a/static/js/stream_popover.js
+++ b/static/js/stream_popover.js
@@ -15,7 +15,6 @@ import * as hash_util from "./hash_util";
import * as message_edit from "./message_edit";
import * as muting from "./muting";
import * as muting_ui from "./muting_ui";
-import * as narrow from "./narrow";
import {page_params} from "./page_params";
import * as popovers from "./popovers";
import * as resize from "./resize";
@@ -522,42 +521,7 @@ export function register_stream_handlers() {
});
}
-function topic_popover_sub(e) {
- const stream_id = topic_popover_stream_id(e);
- if (!stream_id) {
- blueslip.error("cannot find stream id");
- return undefined;
- }
-
- const sub = stream_data.get_sub_by_id(stream_id);
- if (!sub) {
- blueslip.error("Unknown stream: " + stream_id);
- return undefined;
- }
- return sub;
-}
-
export function register_topic_handlers() {
- // Narrow to topic
- $("body").on("click", ".narrow_to_topic", (e) => {
- hide_topic_popover();
-
- const sub = topic_popover_sub(e);
- if (!sub) {
- return;
- }
-
- const topic = $(e.currentTarget).attr("data-topic-name");
-
- const operators = [
- {operator: "stream", operand: sub.name},
- {operator: "topic", operand: topic},
- ];
- narrow.activate(operators, {trigger: "sidebar"});
-
- e.stopPropagation();
- });
-
// Mute the topic
$("body").on("click", ".sidebar-popover-mute-topic", (e) => {
const stream_id = topic_popover_stream_id(e);
diff --git a/static/templates/topic_sidebar_actions.hbs b/static/templates/topic_sidebar_actions.hbs
index ddaec3d826b..ce8893d00a3 100644
--- a/static/templates/topic_sidebar_actions.hbs
+++ b/static/templates/topic_sidebar_actions.hbs
@@ -8,15 +8,6 @@
<hr>
- {{! tabindex="0" Makes anchor tag focusable. Needed for keyboard support. }}
- <li>
- <a tabindex="0" class="narrow_to_topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
- <i class="fa fa-bullhorn" aria-hidden="true"></i>
- {{t "Narrow to topic"}}
- </a>
- </li>
-
-
{{#if can_mute_topic}}
<li>
<a tabindex="0" class="sidebar-popover-mute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">