From e66eeb44443af20b3ae286101f8fa3ba33f2765a Mon Sep 17 00:00:00 2001 From: Daniil Fadeev Date: Thu, 14 Sep 2023 20:37:07 +0400 Subject: [PATCH] user_card_popover: Rename item getter functions. Renamed functions: `get_user_info_popover_items` -> `get_user_card_popover_items` `get_user_info_popover_for_message_items` -> `get_user_card_popover_for_message_items` `get_user_info_popover_manage_menu_items` -> `get_user_card_popover_manage_menu_items` --- web/src/popovers.js | 2 +- web/src/user_card_popover.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web/src/popovers.js b/web/src/popovers.js index be4869ff13..0dca9cb035 100644 --- a/web/src/popovers.js +++ b/web/src/popovers.js @@ -67,7 +67,7 @@ export function popover_items_handle_keyboard(key, $items) { if (key === "enter" && index >= 0 && index < $items.length) { $items[index].click(); if (user_card_popover.is_user_card_manage_menu_open()) { - const $items = user_card_popover.get_user_info_popover_manage_menu_items(); + const $items = user_card_popover.get_user_card_popover_manage_menu_items(); focus_first_popover_item($items); } return; diff --git a/web/src/user_card_popover.js b/web/src/user_card_popover.js index e177f09462..c940dfe382 100644 --- a/web/src/user_card_popover.js +++ b/web/src/user_card_popover.js @@ -106,11 +106,11 @@ export function is_user_card_open() { } export function user_card_popover_handle_keyboard(key) { - const $items = get_user_info_popover_items(); + const $items = get_user_card_popover_items(); popover_items_handle_keyboard(key, $items); } -function get_user_info_popover_items() { +function get_user_card_popover_items() { const $popover_elt = $("div.user-card-popover"); if (!$current_user_card_popover_elem || !$popover_elt.length) { blueslip.error("Trying to get menu items when action popover is closed."); @@ -386,11 +386,11 @@ export function is_user_card_manage_menu_open() { } export function user_card_popover_manage_menu_handle_keyboard(key) { - const $items = get_user_info_popover_manage_menu_items(); + const $items = get_user_card_popover_manage_menu_items(); popover_items_handle_keyboard(key, $items); } -export function get_user_info_popover_manage_menu_items() { +export function get_user_card_popover_manage_menu_items() { if (!$current_user_card_popover_manage_menu) { blueslip.error("Trying to get menu items when action popover is closed."); return undefined; @@ -467,7 +467,7 @@ export function toggle_sender_info() { function focus_user_info_popover_item() { // For now I recommend only calling this when the user opens the menu with a hotkey. // Our popup menus act kind of funny when you mix keyboard and mouse. - const $items = get_user_info_popover_for_message_items(); + const $items = get_user_card_popover_for_message_items(); if ($(".user-card-popover-manage-menu-btn").is(":visible")) { focus_first_popover_item($items, 1); @@ -488,11 +488,11 @@ export function hide_message_user_card_popover() { } export function user_card_popover_for_message_handle_keyboard(key) { - const $items = get_user_info_popover_for_message_items(); + const $items = get_user_card_popover_for_message_items(); popover_items_handle_keyboard(key, $items); } -function get_user_info_popover_for_message_items() { +function get_user_card_popover_for_message_items() { if (!$current_message_user_card_popover_elem) { blueslip.error("Trying to get menu items when action popover is closed."); return undefined;