Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
settings: Disable submit button when no input is changed.
Sahil Batra00424748f4c3
diff --git a/web/src/stream_edit.js b/web/src/stream_edit.jsindex fca13c3328d..cfb1a223c29 100644--- a/web/src/stream_edit.js+++ b/web/src/stream_edit.js@@ -454,6 +454,7 @@ export function initialize() {.addClass("save-button").attr("data-stream-id", stream_id);},+ update_submit_disabled_state_on_change: true,});});@@ -504,10 +505,6 @@ export function initialize() {const new_name = $("#change_stream_name").val().trim();const new_description = $("#change_stream_description").val().trim();- if (new_name === sub.name && new_description === sub.description) {- dialog_widget.hide_dialog_spinner();- return;- }if (new_name !== sub.name) {data.new_name = new_name;}diff --git a/web/src/user_group_edit.js b/web/src/user_group_edit.jsindex 01ec43ef47e..939dd8ca009 100644--- a/web/src/user_group_edit.js+++ b/web/src/user_group_edit.js@@ -277,6 +277,7 @@ export function initialize() {.addClass("save-button").attr("data-group-id", user_group_id);},+ update_submit_disabled_state_on_change: true,});});@@ -328,9 +329,6 @@ export function initialize() {const new_name = $("#change_user_group_name").val().trim();const new_description = $("#change_user_group_description").val().trim();- if (new_name === group.name && new_description === group.description) {- return;- }if (new_name !== group.name) {data.name = new_name;}diff --git a/web/templates/stream_settings/change_stream_info_modal.hbs b/web/templates/stream_settings/change_stream_info_modal.hbsindex ceba4292b1f..60fa918ae5b 100644--- a/web/templates/stream_settings/change_stream_info_modal.hbs+++ b/web/templates/stream_settings/change_stream_info_modal.hbs@@ -2,12 +2,12 @@<label for="change_stream_name">{{t 'Stream name' }}</label>- <input type="text" id="change_stream_name" class="modal_text_input" value="{{ stream_name }}" maxlength="{{ max_stream_name_length }}" />+ <input type="text" id="change_stream_name" class="modal_text_input" name="stream_name" value="{{ stream_name }}" maxlength="{{ max_stream_name_length }}" /></div><div><label for="change_stream_description">{{t 'Description' }}{{> ../help_link_widget link="/help/change-the-stream-description" }}</label>- <textarea id="change_stream_description" class="settings_textarea" maxlength="{{ max_stream_description_length }}">{{ stream_description }}</textarea>+ <textarea id="change_stream_description" class="settings_textarea" name="stream_description" maxlength="{{ max_stream_description_length }}">{{ stream_description }}</textarea></div>diff --git a/web/templates/user_group_settings/change_user_group_info_modal.hbs b/web/templates/user_group_settings/change_user_group_info_modal.hbsindex d2f2e8ab12b..ed0a5d1ee8a 100644--- a/web/templates/user_group_settings/change_user_group_info_modal.hbs+++ b/web/templates/user_group_settings/change_user_group_info_modal.hbs@@ -2,11 +2,11 @@<label for="change_user_group_name">{{t 'User group name' }}</label>- <input type="text" id="change_user_group_name" class="modal_text_input" value="{{ group_name }}" maxlength="{{max_user_group_name_length}}" />+ <input type="text" id="change_user_group_name" class="modal_text_input" name="user_group_name" value="{{ group_name }}" maxlength="{{max_user_group_name_length}}" /></div><div><label for="change_user_group_description">{{t 'User group description' }}</label>- <textarea id="change_user_group_description" class="settings_textarea">{{ group_description }}</textarea>+ <textarea id="change_user_group_description" class="settings_textarea" name="user_group_description">{{ group_description }}</textarea></div>