Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

popovers: Export focus_first_popover_item function from popovers.js.

Mohit Gupta6bccadd0b6d7
diff --git a/static/js/popovers.js b/static/js/popovers.js
index c58503a7452..887b2c937c8 100644
--- a/static/js/popovers.js
+++ b/static/js/popovers.js
@@ -561,13 +561,13 @@ function get_action_menu_menu_items() {
return $("li:not(.divider):visible a", popover_data.$tip);
}
-function focus_first_popover_item(items) {
+exports.focus_first_popover_item = (items) => {
if (!items) {
return;
}
items.eq(0).expectOne().trigger("focus");
-}
+};
function popover_items_handle_keyboard(key, items) {
if (!items) {
@@ -593,7 +593,7 @@ function focus_first_action_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_action_menu_menu_items();
- focus_first_popover_item(items);
+ exports.focus_first_popover_item(items);
}
exports.open_message_menu = function (message) {
@@ -687,7 +687,7 @@ 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();
- focus_first_popover_item(items);
+ exports.focus_first_popover_item(items);
}
exports.user_info_popover_handle_keyboard = function (key) {