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.

click_handlers: Extract function to mute topic.

Aman Agrawal16a775339082
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index 7e3bc166546..bdf57ccb3ad 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -416,12 +416,15 @@ export function initialize() {
});
// MUTING
+ function mute_topic($elt) {
+ const stream_id = Number.parseInt($elt.attr("data-stream-id"), 10);
+ const topic = $elt.attr("data-topic-name");
+ muting_ui.mute_topic(stream_id, topic);
+ }
$("body").on("click", ".on_hover_topic_mute", (e) => {
e.stopPropagation();
- const stream_id = Number.parseInt($(e.currentTarget).attr("data-stream-id"), 10);
- const topic = $(e.currentTarget).attr("data-topic-name");
- muting_ui.mute_topic(stream_id, topic);
+ mute_topic($(e.target));
});
$("body").on("keydown", ".on_hover_topic_mute", convert_enter_to_click);