From 625245af50368f559a945317534279e177e0676e Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Wed, 23 Oct 2024 11:59:32 -0500 Subject: [PATCH] left_sidebar: Maintain Channels hover state while showing popover. --- web/src/add_stream_options_popover.ts | 5 +++++ web/styles/left_sidebar.css | 30 +++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/web/src/add_stream_options_popover.ts b/web/src/add_stream_options_popover.ts index e7b4f2c5d8..cb5d4e5ea7 100644 --- a/web/src/add_stream_options_popover.ts +++ b/web/src/add_stream_options_popover.ts @@ -31,6 +31,8 @@ export function initialize(): void { instance.setContent(parse_html(render_left_sidebar_stream_setting_popover())); popover_menus.on_show_prep(instance); + $("#streams_header").addClass("showing-streams-popover"); + // When showing the popover menu, we want the // "Add channels" and the "Filter channels" tooltip // to appear below the "Add channels" icon. @@ -55,6 +57,9 @@ export function initialize(): void { onHidden(instance) { instance.destroy(); popover_menus.popover_instances.stream_settings = null; + + $("#streams_header").removeClass("showing-streams-popover"); + // After the popover menu is closed, we want the // "Add channels" and the "Filter channels" tooltip // to appear at it's original position that is diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css index f8ee22fc60..54ec179b83 100644 --- a/web/styles/left_sidebar.css +++ b/web/styles/left_sidebar.css @@ -1556,16 +1556,6 @@ li.topic-list-item { background-color: var(--color-background); border-radius: 4px; - &:hover { - background-color: var(--color-background-opaque-hover-narrow-filter); - box-shadow: inset 0 0 0 1px var(--color-shadow-sidebar-row-hover); - - .left-sidebar-title, - .sidebar-heading-icon { - opacity: var(--opacity-sidebar-heading-hover); - } - } - &.showing-stream-search-section { /* Open up the stream-search rows. The 10px row maintains space with the streams list @@ -1610,10 +1600,6 @@ li.topic-list-item { } } - &:hover #filter_streams_tooltip { - display: flex; - } - #add_streams_tooltip { grid-row: 1 / 1; margin: 2px 0; @@ -1632,8 +1618,20 @@ li.topic-list-item { } } - &:hover #streams_inline_icon { - display: flex; + &:hover, + &.showing-streams-popover { + background-color: var(--color-background-opaque-hover-narrow-filter); + box-shadow: inset 0 0 0 1px var(--color-shadow-sidebar-row-hover); + + .left-sidebar-title, + .sidebar-heading-icon { + opacity: var(--opacity-sidebar-heading-hover); + } + + #filter_streams_tooltip, + #streams_inline_icon { + display: flex; + } } .stream_search_section {