compose: Refactor functions for handling max length limits.

Refactors `check_overflow_text` and `validate_message_length` functions.
This commit ensures that there won't be any change in the existing UI
of the compose box with the refactoring of the above functions.
This commit is contained in:
opmkumar
2024-12-04 07:46:52 +05:30
committed by Tim Abbott
parent 7c53e8c90b
commit 88727862b4
9 changed files with 74 additions and 19 deletions

View File

@@ -70,7 +70,7 @@ export function initialize() {
$("textarea#compose-textarea").on("input propertychange", () => {
compose_validate.warn_if_topic_resolved(false);
const compose_text_length = compose_validate.check_overflow_text();
const compose_text_length = compose_validate.check_overflow_text($("#send_message_form"));
if (compose_text_length !== 0 && $("textarea#compose-textarea").hasClass("invalid")) {
$("textarea#compose-textarea").toggleClass("invalid", false);
}