tooltips: Add hotkey hints support to narrow to compose option.

This commit is contained in:
sayamsamal 2022-09-12 01:58:54 +05:30 committed by Tim Abbott
parent fc6b4775be
commit 4a7ad5325a
3 changed files with 8 additions and 11 deletions

View File

@ -5,7 +5,6 @@ import tippy, {delegate} from "tippy.js";
import render_message_inline_image_tooltip from "../templates/message_inline_image_tooltip.hbs";
import render_narrow_to_compose_recipients_tooltip from "../templates/narrow_to_compose_recipients_tooltip.hbs";
import * as common from "./common";
import * as compose_state from "./compose_state";
import {$t} from "./i18n";
import * as message_lists from "./message_lists";
@ -273,10 +272,7 @@ export function initialize() {
}
}
const shortcut_html = (common.has_mac_keyboard() ? "⌘" : "Ctrl") + " + .";
return parse_html(
render_narrow_to_compose_recipients_tooltip({shortcut_html, display_current_view}),
);
return parse_html(render_narrow_to_compose_recipients_tooltip({display_current_view}));
},
onHidden(instance) {
instance.destroy();

View File

@ -227,8 +227,6 @@ function initialize_compose_box() {
scroll_to_bottom_key_html: common.has_mac_keyboard()
? "Fn + <span class='tooltip_right_arrow'>→</span>"
: "End",
narrow_to_compose_recipients_key_html:
(common.has_mac_keyboard() ? "⌘" : "Ctrl") + " + .",
max_stream_name_length: page_params.max_stream_name_length,
max_topic_length: page_params.max_topic_length,
}),

View File

@ -1,4 +1,7 @@
<span>{{t 'Go to conversation' }}</span> <span class="hotkey-hint">({{shortcut_html}})</span>
<div>
<span>{{t 'Go to conversation' }}</span>
{{#if display_current_view}}
<p class="narrow_to_compose_recipient_current_view_help">{{display_current_view}}</p>
{{/if}}
</div>
{{hotkey_hints "Ctrl" "."}}