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.

left-sidebar: Show the 3-dots icon when the menu is selected.

Eyuel Berga Woldemichaelc8cfef0581d2
diff --git a/static/js/stream_popover.js b/static/js/stream_popover.js
index 48e8a4c01c6..bef37dea3fa 100644
--- a/static/js/stream_popover.js
+++ b/static/js/stream_popover.js
@@ -49,6 +49,16 @@ let drafts_sidebar_elem;
let stream_widget;
let $stream_header_colorblock;
+// Keep the menu icon over which the popover is based off visible.
+function show_left_sidebar_menu_icon(element) {
+ $(element).closest("[class*='-sidebar-menu-icon']").addClass("left_sidebar_menu_icon_visible");
+}
+
+// Remove the class from element when popover is closed
+function hide_left_sidebar_menu_icon() {
+ $(".left_sidebar_menu_icon_visible").removeClass("left_sidebar_menu_icon_visible");
+}
+
function get_popover_menu_items(sidebar_elem) {
if (!sidebar_elem) {
blueslip.error("Trying to get menu items when action popover is closed.");
@@ -120,6 +130,7 @@ export function drafts_popped() {
export function hide_stream_popover() {
if (stream_popped()) {
$(current_stream_sidebar_elem).popover("destroy");
+ hide_left_sidebar_menu_icon();
current_stream_sidebar_elem = undefined;
}
}
@@ -127,6 +138,7 @@ export function hide_stream_popover() {
export function hide_topic_popover() {
if (topic_popped()) {
$(current_topic_sidebar_elem).popover("destroy");
+ hide_left_sidebar_menu_icon();
current_topic_sidebar_elem = undefined;
}
}
@@ -134,6 +146,7 @@ export function hide_topic_popover() {
export function hide_all_messages_popover() {
if (all_messages_popped()) {
$(all_messages_sidebar_elem).popover("destroy");
+ hide_left_sidebar_menu_icon();
all_messages_sidebar_elem = undefined;
}
}
@@ -141,6 +154,7 @@ export function hide_all_messages_popover() {
export function hide_starred_messages_popover() {
if (starred_messages_popped()) {
$(starred_messages_sidebar_elem).popover("destroy");
+ hide_left_sidebar_menu_icon();
starred_messages_sidebar_elem = undefined;
}
}
@@ -148,6 +162,7 @@ export function hide_starred_messages_popover() {
export function hide_drafts_popover() {
if (drafts_popped()) {
$(drafts_sidebar_elem).popover("destroy");
+ hide_left_sidebar_menu_icon();
drafts_sidebar_elem = undefined;
}
}
@@ -257,6 +272,7 @@ function build_stream_popover(opts) {
});
current_stream_sidebar_elem = elt;
+ show_left_sidebar_menu_icon(elt);
}
function build_topic_popover(opts) {
@@ -307,6 +323,7 @@ function build_topic_popover(opts) {
$(elt).popover("show");
current_topic_sidebar_elem = elt;
+ show_left_sidebar_menu_icon(elt);
}
function build_all_messages_popover(e) {
@@ -332,6 +349,7 @@ function build_all_messages_popover(e) {
$(elt).popover("show");
all_messages_sidebar_elem = elt;
+ show_left_sidebar_menu_icon(elt);
e.stopPropagation();
}
@@ -362,6 +380,7 @@ function build_starred_messages_popover(e) {
$(elt).popover("show");
starred_messages_sidebar_elem = elt;
+ show_left_sidebar_menu_icon(elt);
e.stopPropagation();
}
@@ -386,6 +405,7 @@ function build_drafts_popover(e) {
$(elt).popover("show");
drafts_sidebar_elem = elt;
+ show_left_sidebar_menu_icon(elt);
e.stopPropagation();
}
diff --git a/static/styles/left_sidebar.css b/static/styles/left_sidebar.css
index f6367fd9ef6..f82e8aa7eb2 100644
--- a/static/styles/left_sidebar.css
+++ b/static/styles/left_sidebar.css
@@ -387,6 +387,10 @@ li.top_left_recent_topics {
line-height: 1.1;
}
+.left_sidebar_menu_icon_visible {
+ display: block !important;
+}
+
/*
All of our left sidebar handlers use absolute
positioning. We should fix that.