From fc8ceceb1dceaf38388d411e69c2bd0b46ff4063 Mon Sep 17 00:00:00 2001 From: sahil839 Date: Sat, 19 Sep 2020 22:01:41 +0530 Subject: [PATCH] popover: Rename keyboard handling functions for message user popovers. We rename user_info_popover_handle_keyboard and get_user_info_popover_items to user_info_popover_for_message_handle_keyboard and get_user_info_popover_for_message items to differentiate it from functions that will be added for bot-owner popovers. --- static/js/hotkey.js | 2 +- static/js/popovers.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 6a28bf73c1..f3675acbbc 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -575,7 +575,7 @@ exports.process_hotkey = function (e, hotkey) { } if (popovers.message_info_popped()) { - popovers.user_info_popover_handle_keyboard(event_name); + popovers.user_info_popover_for_message_handle_keyboard(event_name); return true; } diff --git a/static/js/popovers.js b/static/js/popovers.js index fc1d7982a2..cf3d23a4ab 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -349,7 +349,7 @@ exports.show_user_profile = function (user) { ); }; -function get_user_info_popover_items() { +function get_user_info_popover_for_message_items() { if (!current_message_info_popover_elem) { blueslip.error("Trying to get menu items when action popover is closed."); return; @@ -687,7 +687,7 @@ exports.hide_user_sidebar_popover = function () { 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_items(); + const items = get_user_info_popover_for_message_items(); exports.focus_first_popover_item(items); } @@ -705,8 +705,8 @@ exports.user_sidebar_popover_handle_keyboard = function (key) { exports.popover_items_handle_keyboard(key, items); }; -exports.user_info_popover_handle_keyboard = function (key) { - const items = get_user_info_popover_items(); +exports.user_info_popover_for_message_handle_keyboard = function (key) { + const items = get_user_info_popover_for_message_items(); exports.popover_items_handle_keyboard(key, items); };