From 566e5e688bfe5c48d8bbecd19f4bd37897f47703 Mon Sep 17 00:00:00 2001 From: Pratik Chanda Date: Fri, 22 Nov 2024 02:13:33 +0530 Subject: [PATCH] navbar_menu: Refactor keyboard events for navbar menu. This commit extracts menu switching logic from `handle_keyboard_events` to separate `change_active_navbar_menu` to toggle between the current active navbar menu and the adjacent navbar menu. --- web/src/navbar_menus.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/navbar_menus.js b/web/src/navbar_menus.js index 54310f503d..08b77d76eb 100644 --- a/web/src/navbar_menus.js +++ b/web/src/navbar_menus.js @@ -17,7 +17,10 @@ export function handle_keyboard_events(event_name) { if (!allowed_events.has(event_name)) { return false; } + return change_active_navbar_menu(event_name); +} +function change_active_navbar_menu(event_name) { // We don't need to process arrow keys in navbar menus for spectators // since they only have gear menu present. if (