mirror of
https://github.com/zulip/zulip.git
synced 2025-10-26 01:24:02 +00:00
stream_popover: Show clear button if topic input is not disabled.
Previously, if the topic input was disabled when "Move messages" modal was opened, the clear button was not added to the DOM which caused the bug where the clear button was not shown even if the topic input was later enabled because user was allowed to edit topics in the selected channel.
This commit is contained in:
@@ -884,6 +884,7 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
set_stream_topic_typeahead();
|
set_stream_topic_typeahead();
|
||||||
render_selected_stream();
|
render_selected_stream();
|
||||||
maybe_show_topic_already_exists_warning();
|
maybe_show_topic_already_exists_warning();
|
||||||
|
update_clear_move_topic_button_state();
|
||||||
update_topic_input_placeholder_visibility(topic_input_value);
|
update_topic_input_placeholder_visibility(topic_input_value);
|
||||||
const selected_propagate_mode = String($("#message_move_select_options").val());
|
const selected_propagate_mode = String($("#message_move_select_options").val());
|
||||||
void warn_unsubscribed_participants(selected_propagate_mode);
|
void warn_unsubscribed_participants(selected_propagate_mode);
|
||||||
@@ -989,7 +990,7 @@ export async function build_move_topic_to_stream_popover(
|
|||||||
function update_clear_move_topic_button_state(): void {
|
function update_clear_move_topic_button_state(): void {
|
||||||
const $clear_topic_name_button = $("#clear_move_topic_new_topic_name");
|
const $clear_topic_name_button = $("#clear_move_topic_new_topic_name");
|
||||||
const topic_input_value = $("input#move-topic-new-topic-name").val();
|
const topic_input_value = $("input#move-topic-new-topic-name").val();
|
||||||
if (topic_input_value === "") {
|
if (topic_input_value === "" || $("input#move-topic-new-topic-name").prop("disabled")) {
|
||||||
$clear_topic_name_button.css("visibility", "hidden");
|
$clear_topic_name_button.css("visibility", "hidden");
|
||||||
} else {
|
} else {
|
||||||
$clear_topic_name_button.css("visibility", "visible");
|
$clear_topic_name_button.css("visibility", "visible");
|
||||||
|
|||||||
@@ -14,11 +14,9 @@
|
|||||||
<span class="move-topic-new-topic-placeholder placeholder">
|
<span class="move-topic-new-topic-placeholder placeholder">
|
||||||
{{> topic_not_mandatory_placeholder_text empty_string_topic_display_name=empty_string_topic_display_name}}
|
{{> topic_not_mandatory_placeholder_text empty_string_topic_display_name=empty_string_topic_display_name}}
|
||||||
</span>
|
</span>
|
||||||
{{#unless disable_topic_input}}
|
|
||||||
<button type="button" id="clear_move_topic_new_topic_name" class="clear_search_button">
|
<button type="button" id="clear_move_topic_new_topic_name" class="clear_search_button">
|
||||||
<i class="zulip-icon zulip-icon-close"></i>
|
<i class="zulip-icon zulip-icon-close"></i>
|
||||||
</button>
|
</button>
|
||||||
{{/unless}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input name="old_topic_name" type="hidden" value="{{topic_name}}" />
|
<input name="old_topic_name" type="hidden" value="{{topic_name}}" />
|
||||||
|
|||||||
Reference in New Issue
Block a user