mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
navbar: Add navigate to home view tooltip to the organization logo.
The organization logo in the upper left navigates to the user's home view. We add a tooltip to make this easier to discover. We show `Esc` as the keyboard shortcut here, unless the user has disabled it, in which case we show the alt shortcut `Ctrl` + `[`. Fixes #29185.
This commit is contained in:
@@ -3,11 +3,13 @@ import assert from "minimalistic-assert";
|
||||
import tippy, {delegate} from "tippy.js";
|
||||
|
||||
import render_buddy_list_title_tooltip from "../templates/buddy_list/title_tooltip.hbs";
|
||||
import render_org_logo_tooltip from "../templates/org_logo_tooltip.hbs";
|
||||
import render_tooltip_templates from "../templates/tooltip_templates.hbs";
|
||||
|
||||
import {$t} from "./i18n";
|
||||
import * as people from "./people";
|
||||
import * as popovers from "./popovers";
|
||||
import * as settings_config from "./settings_config";
|
||||
import * as ui_util from "./ui_util";
|
||||
import {user_settings} from "./user_settings";
|
||||
|
||||
@@ -575,4 +577,20 @@ export function initialize(): void {
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
delegate("body", {
|
||||
target: "#realm-logo",
|
||||
placement: "right",
|
||||
appendTo: () => document.body,
|
||||
onShow(instance) {
|
||||
const escape_navigates_to_home_view = user_settings.web_escape_navigates_to_home_view;
|
||||
const home_view =
|
||||
settings_config.web_home_view_values[user_settings.web_home_view].description;
|
||||
instance.setContent(
|
||||
ui_util.parse_html(
|
||||
render_org_logo_tooltip({home_view, escape_navigates_to_home_view}),
|
||||
),
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user