mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
topic_edit: Show "general chat" placeholder when mandatory_topics=false.
This commit updates the inline topic edit form to always show the empty string topic placeholder when `mandatory_topics = false`. It also improves the styling to make it italics.
This commit is contained in:
committed by
Tim Abbott
parent
2416fec468
commit
9a72a4df03
@@ -899,6 +899,8 @@ export function start_inline_topic_edit($recipient_row: JQuery): void {
|
||||
const $form = $(
|
||||
render_topic_edit_form({
|
||||
max_topic_length: realm.max_topic_length,
|
||||
realm_mandatory_topics: realm.realm_mandatory_topics,
|
||||
empty_string_topic_display_name: util.get_final_topic_display_name(""),
|
||||
}),
|
||||
);
|
||||
message_lists.current.show_edit_topic_on_recipient_row($recipient_row, $form);
|
||||
@@ -912,10 +914,6 @@ export function start_inline_topic_edit($recipient_row: JQuery): void {
|
||||
const topic = message.topic;
|
||||
const $inline_topic_edit_input = $form.find<HTMLInputElement>("input.inline_topic_edit");
|
||||
$inline_topic_edit_input.val(topic).trigger("select").trigger("focus");
|
||||
if (topic === "") {
|
||||
const topic_display_name = util.get_final_topic_display_name(topic);
|
||||
$inline_topic_edit_input.attr("placeholder", topic_display_name);
|
||||
}
|
||||
const stream_name = stream_data.get_stream_name_from_id(message.stream_id);
|
||||
composebox_typeahead.initialize_topic_edit_typeahead(
|
||||
$inline_topic_edit_input,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{{! Client-side Handlebars template for rendering the topic edit form. }}
|
||||
|
||||
<form id="topic_edit_form">
|
||||
<input type="text" value="" class="inline_topic_edit header-v"
|
||||
autocomplete="off" maxlength="{{ max_topic_length }}" />
|
||||
<input type="text" value="" autocomplete="off" maxlength="{{ max_topic_length }}"
|
||||
class="inline_topic_edit header-v {{#unless realm_mandatory_topics}}empty-topic-placeholder-display{{/unless}}"
|
||||
{{#unless realm_mandatory_topics}}placeholder="{{empty_string_topic_display_name}}"{{/unless}} />
|
||||
<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>
|
||||
<div class="alert alert-error edit_error" style="display: none"></div>
|
||||
|
||||
Reference in New Issue
Block a user