message-edit: Add maxlength attribute for editing topic names.

This commit is contained in:
jai2201
2022-07-15 06:59:38 +05:30
committed by Tim Abbott
parent 97ffeb0b7e
commit 511c589e2d
2 changed files with 6 additions and 2 deletions

View File

@@ -710,7 +710,11 @@ export function toggle_resolve_topic(message_id, old_topic_name) {
} }
export function start_inline_topic_edit($recipient_row) { export function start_inline_topic_edit($recipient_row) {
const $form = $(render_topic_edit_form()); const $form = $(
render_topic_edit_form({
max_topic_length: page_params.max_topic_length,
}),
);
message_lists.current.show_edit_topic_on_recipient_row($recipient_row, $form); message_lists.current.show_edit_topic_on_recipient_row($recipient_row, $form);
$form.on("keydown", handle_inline_topic_edit_keydown); $form.on("keydown", handle_inline_topic_edit_keydown);
$(".topic_edit_spinner").hide(); $(".topic_edit_spinner").hide();

View File

@@ -2,7 +2,7 @@
<form id="topic_edit_form" class="form-horizontal"> <form id="topic_edit_form" class="form-horizontal">
<input type="text" value="" class="inline_topic_edit header-v" id="inline_topic_edit" <input type="text" value="" class="inline_topic_edit header-v" id="inline_topic_edit"
autocomplete="off" /> autocomplete="off" maxlength="{{ max_topic_length }}" />
<button type="button" class="topic_edit_save small_square_button animated-purple-button"><i class="fa fa-check" aria-hidden="true"></i></button> <button type="button" class="topic_edit_save small_square_button animated-purple-button"><i class="fa fa-check" aria-hidden="true"></i></button>
<button type="button" class="topic_edit_cancel small_square_button small_square_x"><i class="fa fa-remove" aria-hidden="true"></i></button> <button type="button" class="topic_edit_cancel small_square_button small_square_x"><i class="fa fa-remove" aria-hidden="true"></i></button>
<div class="alert alert-error edit_error" style="display: none"></div> <div class="alert alert-error edit_error" style="display: none"></div>