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.

tooltip: Change placement of tooltip according to the popover menu.

sbansal1999f0ef0f7157ec
diff --git a/web/src/popover_menus.js b/web/src/popover_menus.js
index 6dd73face65..e2373e6d008 100644
--- a/web/src/popover_menus.js
+++ b/web/src/popover_menus.js
@@ -211,11 +211,37 @@ export function initialize() {
}
instance.setContent(parse_html(render_left_sidebar_stream_setting_popover()));
+ // When showing the popover menu, we want the
+ // "Add streams" and the "Filter streams" tooltip
+ // to appear below the "Add streams" icon.
+ const add_streams_tooltip = $("#add_streams_tooltip").get(0);
+ add_streams_tooltip._tippy?.setProps({
+ placement: "bottom",
+ });
+ const filter_streams_tooltip = $("#filter_streams_tooltip").get(0);
+ // If `filter_streams_tooltip` is not triggered yet, this will set its initial placement.
+ filter_streams_tooltip.dataset.tippyPlacement = "bottom";
+ filter_streams_tooltip._tippy?.setProps({
+ placement: "bottom",
+ });
return true;
},
onHidden(instance) {
instance.destroy();
popover_instances.stream_settings = undefined;
+ // After the popover menu is closed, we want the
+ // "Add streams" and the "Filter streams" tooltip
+ // to appear at it's original position that is
+ // above the "Add streams" icon.
+ const add_streams_tooltip = $("#add_streams_tooltip").get(0);
+ add_streams_tooltip._tippy?.setProps({
+ placement: "top",
+ });
+ const filter_streams_tooltip = $("#filter_streams_tooltip").get(0);
+ filter_streams_tooltip.dataset.tippyPlacement = "top";
+ filter_streams_tooltip._tippy?.setProps({
+ placement: "top",
+ });
},
});