mirror of https://github.com/zulip/zulip.git
digest: Toggle display of digest weekday setting dynamically.
Hide or show the digest weekday setting, based on whether `digest_emails_enabled` flag is turned on or off.
This commit is contained in:
parent
55a4c5751d
commit
b016ab257e
|
@ -761,6 +761,7 @@ run_test('set_up', () => {
|
|||
$("#id_realm_message_content_delete_limit_minutes").set_parent($.create('<stub delete limti parent>'));
|
||||
$("#message_content_in_email_notifications_label").set_parent($.create('<stub in-content setting checkbox>'));
|
||||
$("#enable_digest_emails_label").set_parent($.create('<stub digest setting checkbox>'));
|
||||
$("#id_realm_digest_weekday").set_parent($.create('<stub digest weekday setting dropdown>'));
|
||||
$("#id_realm_msg_edit_limit_setting").change = noop;
|
||||
$('#id_realm_msg_delete_limit_setting').change = noop;
|
||||
const waiting_period_parent_elem = $.create('waiting-period-parent-stub');
|
||||
|
|
|
@ -282,6 +282,14 @@ function set_enable_digest_emails_visibility() {
|
|||
}
|
||||
}
|
||||
|
||||
function set_digest_emails_weekday_visibility() {
|
||||
if (page_params.realm_digest_emails_enabled) {
|
||||
$('#id_realm_digest_weekday').parent().show();
|
||||
} else {
|
||||
$('#id_realm_digest_weekday').parent().hide();
|
||||
}
|
||||
}
|
||||
|
||||
exports.populate_realm_domains = function (realm_domains) {
|
||||
if (!meta.loaded) {
|
||||
return;
|
||||
|
@ -430,6 +438,7 @@ function update_dependent_subsettings(property_name) {
|
|||
set_message_content_in_email_notifications_visiblity();
|
||||
} else if (property_name === 'realm_digest_emails_enabled') {
|
||||
set_enable_digest_emails_visibility();
|
||||
set_digest_emails_weekday_visibility();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,6 +602,7 @@ exports.build_page = function () {
|
|||
set_user_invite_restriction_dropdown();
|
||||
set_message_content_in_email_notifications_visiblity();
|
||||
set_enable_digest_emails_visibility();
|
||||
set_digest_emails_weekday_visibility();
|
||||
|
||||
function check_property_changed(elem) {
|
||||
elem = $(elem);
|
||||
|
|
Loading…
Reference in New Issue