diff --git a/static/js/settings_display.js b/static/js/settings_display.js index 2281bdfd8e..14788a2118 100644 --- a/static/js/settings_display.js +++ b/static/js/settings_display.js @@ -106,42 +106,40 @@ export function set_up(settings_panel) { }); } - if (!for_realm_settings) { - $(language_modal_elem) - .find(".language") - .on("click", (e) => { - e.preventDefault(); - e.stopPropagation(); - overlays.close_modal(language_modal_elem); - - const $link = $(e.target).closest("a[data-code]"); - const setting_value = $link.attr("data-code"); - const data = {default_language: setting_value}; - - const new_language = $link.attr("data-name"); - container.find(".default_language_name").text(new_language); - - change_display_setting( - data, - settings_panel, - ".language-settings-status", - $t_html( - { - defaultMessage: - "Saved. Please reload for the change to take effect.", - }, - {"z-link": (content_html) => `${content_html}`}, - ), - true, - ); - }); - - container.find(".setting_default_language").on("click", (e) => { + $(language_modal_elem) + .find(".language") + .on("click", (e) => { e.preventDefault(); e.stopPropagation(); - overlays.open_modal(language_modal_elem); + overlays.close_modal(language_modal_elem); + + const $link = $(e.target).closest("a[data-code]"); + const setting_value = $link.attr("data-code"); + const data = {default_language: setting_value}; + + const new_language = $link.attr("data-name"); + container.find(".default_language_name").text(new_language); + + change_display_setting( + data, + settings_panel, + ".language-settings-status", + $t_html( + { + defaultMessage: + "Saved. Please reload for the change to take effect.", + }, + {"z-link": (content_html) => `${content_html}`}, + ), + true, + ); }); - } + + container.find(".setting_default_language").on("click", (e) => { + e.preventDefault(); + e.stopPropagation(); + overlays.open_modal(language_modal_elem); + }); container.find(".setting_twenty_four_hour_time").on("change", function () { const data = {twenty_four_hour_time: this.value}; diff --git a/static/js/settings_notifications.js b/static/js/settings_notifications.js index 1736a77116..400e97f803 100644 --- a/static/js/settings_notifications.js +++ b/static/js/settings_notifications.js @@ -161,19 +161,14 @@ export function set_up(settings_panel) { // This final patch of settings are ones for which we // intentionally don't let organization administrators set // organization-level defaults. + container.find(".send_test_notification").on("click", () => { + notifications.send_test_notification( + $t({defaultMessage: "This is what a Zulip notification looks like."}), + ); + }); - if (!for_realm_settings) { - container.find(".send_test_notification").on("click", () => { - notifications.send_test_notification( - $t({defaultMessage: "This is what a Zulip notification looks like."}), - ); - }); - } - - if (!for_realm_settings) { - set_enable_marketing_emails_visibility(); - rerender_ui(); - } + set_enable_marketing_emails_visibility(); + rerender_ui(); } export function update_page(settings_panel) {