mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
settings: Disable save btn for invalid values of batching period setting.
We disable the "Save changes" button for invalid values in custom input of realm-level default of email notification batching period setting.
This commit is contained in:
@@ -888,7 +888,7 @@ export function init_dropdown_widgets() {
|
|||||||
default_code_language_widget.setup();
|
default_code_language_widget.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_save_button_state(e) {
|
export function update_save_button_state(e) {
|
||||||
const $subsection_elem = $(e.target).closest(".org-subsection-parent");
|
const $subsection_elem = $(e.target).closest(".org-subsection-parent");
|
||||||
const time_limit_settings = Array.from($subsection_elem.find(".time-limit-setting"));
|
const time_limit_settings = Array.from($subsection_elem.find(".time-limit-setting"));
|
||||||
let disable_save_btn = false;
|
let disable_save_btn = false;
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ export function set_up() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
maybe_disable_widgets();
|
maybe_disable_widgets();
|
||||||
|
|
||||||
|
$container.on("input", ".email_notification_batching_period_edit_minutes", (e) => {
|
||||||
|
settings_org.update_save_button_state(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
$container.on("change", ".setting_email_notifications_batching_period_seconds", (e) => {
|
||||||
|
settings_org.update_save_button_state(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initialize() {
|
export function initialize() {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
{{> settings_save_discard_widget section_name="email-message-settings" show_only_indicator=(not for_realm_settings) }}
|
{{> settings_save_discard_widget section_name="email-message-settings" show_only_indicator=(not for_realm_settings) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-group form-horizontal">
|
<div class="input-group form-horizontal time-limit-setting">
|
||||||
|
|
||||||
<label for="email_notifications_batching_period">
|
<label for="email_notifications_batching_period">
|
||||||
{{t "Delay before sending message notification emails" }}
|
{{t "Delay before sending message notification emails" }}
|
||||||
|
|||||||
Reference in New Issue
Block a user