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.

tooltips: Change tooltip for channels subscribe/unsubscribe button.

Yaswanth Kosuru8e7180695845
diff --git a/web/src/tippyjs.ts b/web/src/tippyjs.ts
index cdff52f8ef3..52b627ed319 100644
--- a/web/src/tippyjs.ts
+++ b/web/src/tippyjs.ts
@@ -152,6 +152,17 @@ export function initialize(): void {
delay: EXTRA_LONG_HOVER_DELAY,
appendTo: () => document.body,
placement: "bottom",
+ onShow(instance) {
+ let template = "show-unsubscribe-tooltip-template";
+ if (instance.reference.classList.contains("unsubscribed")) {
+ template = "show-subscribe-tooltip-template";
+ }
+ $(instance.reference).attr("data-tooltip-template-id", template);
+ instance.setContent(get_tooltip_content(instance.reference));
+ },
+ onHidden(instance) {
+ instance.destroy();
+ },
});
tippy.delegate("body", {
diff --git a/web/templates/tooltip_templates.hbs b/web/templates/tooltip_templates.hbs
index 2b90174cfa5..66e3dd67c4a 100644
--- a/web/templates/tooltip_templates.hbs
+++ b/web/templates/tooltip_templates.hbs
@@ -239,8 +239,12 @@
{{t 'Create new channel' }}
{{tooltip_hotkey_hints "N"}}
</template>
-<template id="toggle-subscription-tooltip-template">
- {{t 'Toggle subscription' }}
+<template id="show-subscribe-tooltip-template">
+ {{t 'Subscribe to this channel' }}
+ {{tooltip_hotkey_hints "Shift" "S"}}
+</template>
+<template id="show-unsubscribe-tooltip-template">
+ {{t 'Unsubscribe from this channel' }}
{{tooltip_hotkey_hints "Shift" "S"}}
</template>
<template id="view-stream-tooltip-template">