personal_menu: Add tippy personal_menu dropdown.

Add a personal menu dropdown that opens on clicking user avatar icon
in navbar added in previous commit.

The args passed to render_personal_menu() in onShow() are returned by
get_personal_menu_content_context() in popover_menus_data.js so that
they can be unit tested.

Additionally, added CSS to get a custom arrow for dropdown menu.

Added a `?` hotkey in keyboard shortcuts option in personal_menu
dropdown in a style similar to our tooltip's hotkey by adding
? in a span with class .tooltip-hotkey-hint and adding some CSS.

Fixes part of #22802.
This commit is contained in:
Hardik Dharmani
2023-07-17 21:31:16 +05:30
committed by Tim Abbott
parent 5fd8b95454
commit 49f7f02a0a
16 changed files with 536 additions and 6 deletions

View File

@@ -926,4 +926,10 @@ export function initialize() {
$(".settings-header.mobile .fa-chevron-left").on("click", () => {
settings_panel_menu.mobile_deactivate_section();
});
$("body").on("click", ".trigger-natural-click", (e) => {
// Jquery prevents default action on anchor for `trigger("click")`
// so we need to use click on element to trigger the default action.
e.currentTarget.click();
});
}