From 690b4efca8973864e88a276c56a7c596de34aeee Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Mon, 13 Nov 2023 11:05:14 -0600 Subject: [PATCH] left_sidebar: Explicitly handle clicks on collapsible Views targets. --- web/src/left_sidebar_navigation_area.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/web/src/left_sidebar_navigation_area.js b/web/src/left_sidebar_navigation_area.js index 23dbd8a30a..9363c70fe7 100644 --- a/web/src/left_sidebar_navigation_area.js +++ b/web/src/left_sidebar_navigation_area.js @@ -191,15 +191,12 @@ export function handle_home_view_changed(new_home_view) { export function initialize() { update_scheduled_messages_row(); - $("body").on("click", "#views-label-container", (e) => { - if ( - $(e.currentTarget).hasClass("showing-condensed-navigation") && - !($(e.target).hasClass("left-sidebar-title") || $(e.target).hasClass("fa-caret-right")) - ) { - // Ignore clicks on condensed nav items - return; - } - e.stopPropagation(); - toggle_condensed_navigation_area(); - }); + $("body").on( + "click", + "#toggle-top-left-navigation-area-icon, #views-label-container .left-sidebar-title", + (e) => { + e.stopPropagation(); + toggle_condensed_navigation_area(); + }, + ); }