From 0ebe623b428ec2766a3a7c8bcfef14fee45a5933 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Thu, 18 Jan 2024 16:35:04 +0530 Subject: [PATCH] group_settings: Empty right panel based on the url hash. This commit adds code to empty the right panel if hash is changed to "#groups/your" or "#groups/all". (cherry picked from commit fc8e6d2aa8b7223ea0e3902970df2b112db4ea99) --- web/src/user_group_edit.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/user_group_edit.js b/web/src/user_group_edit.js index 9be50c145c..9e2f7ffafa 100644 --- a/web/src/user_group_edit.js +++ b/web/src/user_group_edit.js @@ -379,9 +379,13 @@ export const show_user_group_settings_pane = { }, }; -function open_right_panel_empty() { +function empty_right_panel() { $(".group-row.active").removeClass("active"); show_user_group_settings_pane.nothing_selected(); +} + +function open_right_panel_empty() { + empty_right_panel(); const tab_key = $(".user-groups-container") .find("div.ind-tab.selected") .first() @@ -566,11 +570,13 @@ export function change_state(section) { if (section === "all") { group_list_toggler.goto("all-groups"); + empty_right_panel(); return; } if (section === "your") { group_list_toggler.goto("your-groups"); + empty_right_panel(); return; } @@ -595,6 +601,7 @@ export function change_state(section) { blueslip.info("invalid section for groups: " + section); group_list_toggler.goto("your-groups"); + empty_right_panel(); } function compare_by_name(a, b) {