mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
message_edit: Add message length limit indicator in edit message UI.
Adds a message length limit indicator similar to the one in the compose box. The tooltip message for the disabled save button now appears dynamically based on whether the message exceeds the length limit or the editing time has expired. Fixes #25271.
This commit is contained in:
@@ -6,6 +6,7 @@ import render_message_edit_notice_tooltip from "../templates/message_edit_notice
|
||||
import render_message_inline_image_tooltip from "../templates/message_inline_image_tooltip.hbs";
|
||||
import render_narrow_tooltip from "../templates/narrow_tooltip.hbs";
|
||||
|
||||
import * as compose_validate from "./compose_validate.ts";
|
||||
import {$t} from "./i18n.ts";
|
||||
import * as message_lists from "./message_lists.ts";
|
||||
import type {Message} from "./message_store.ts";
|
||||
@@ -282,6 +283,19 @@ export function initialize(): void {
|
||||
},
|
||||
});
|
||||
|
||||
message_list_tooltip(".disabled-message-edit-save", {
|
||||
onShow(instance) {
|
||||
const $elem = $(instance.reference);
|
||||
const $row = $elem.closest(".message_row");
|
||||
assert($row !== undefined);
|
||||
instance.setContent(compose_validate.get_disabled_save_tooltip($row));
|
||||
return undefined;
|
||||
},
|
||||
onHidden(instance) {
|
||||
instance.destroy();
|
||||
},
|
||||
});
|
||||
|
||||
message_list_tooltip(".recipient_row_date > span", {
|
||||
onHidden(instance) {
|
||||
instance.destroy();
|
||||
|
||||
Reference in New Issue
Block a user