diff --git a/web/src/compose_tooltips.ts b/web/src/compose_tooltips.ts index 6abfa2e9f7..e85b972504 100644 --- a/web/src/compose_tooltips.ts +++ b/web/src/compose_tooltips.ts @@ -13,6 +13,7 @@ import {$t} from "./i18n.ts"; import {pick_empty_narrow_banner} from "./narrow_banner.ts"; import * as narrow_state from "./narrow_state.ts"; import * as popover_menus from "./popover_menus.ts"; +import {realm} from "./state_data.ts"; import {EXTRA_LONG_HOVER_DELAY, INSTANT_HOVER_DELAY, LONG_HOVER_DELAY} from "./tippyjs.ts"; import {parse_html} from "./ui_util.ts"; import {user_settings} from "./user_settings.ts"; @@ -168,6 +169,21 @@ export function initialize(): void { appendTo: () => document.body, }); + tippy.delegate("body", { + target: "#compose-limit-indicator", + delay: INSTANT_HOVER_DELAY, + trigger: "mouseenter", + appendTo: () => document.body, + onShow(instance) { + instance.setContent( + $t( + {defaultMessage: `Maximum message length: {max_length} characters`}, + {max_length: realm.max_message_length}, + ), + ); + }, + }); + tippy.delegate("body", { target: "#compose-send-button", delay: EXTRA_LONG_HOVER_DELAY, diff --git a/web/src/ui_init.js b/web/src/ui_init.js index e0f9d28af7..34e46c6755 100644 --- a/web/src/ui_init.js +++ b/web/src/ui_init.js @@ -185,7 +185,6 @@ function initialize_compose_box() { giphy_enabled: giphy_state.is_giphy_enabled(), max_stream_name_length: realm.max_stream_name_length, max_topic_length: realm.max_topic_length, - max_message_length: realm.max_message_length, }), ), ); diff --git a/web/templates/compose.hbs b/web/templates/compose.hbs index 92f4a2c094..2b9b22eb59 100644 --- a/web/templates/compose.hbs +++ b/web/templates/compose.hbs @@ -89,7 +89,7 @@ {{t 'Drafts' }}() - +