From 28174aeccaf76056651bd31573b894442aa1319d Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Wed, 26 Jun 2024 13:36:58 +0530 Subject: [PATCH] settings: Fade label for disabled checkbox. --- web/src/settings_org.js | 15 +++++++++++---- web/src/settings_realm_user_settings_defaults.js | 5 +++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/src/settings_org.js b/web/src/settings_org.js index 834a6c5361..2339f9f8c9 100644 --- a/web/src/settings_org.js +++ b/web/src/settings_org.js @@ -62,6 +62,11 @@ export function maybe_disable_widgets() { $(".organization-box [data-name='organization-profile']").find(".image_upload_button").hide(); + $(".organization-box [data-name='organization-profile']") + .find("input[type='checkbox']:disabled") + .closest(".input-group") + .addClass("control-label-disabled"); + $(".organization-box [data-name='organization-settings']") .find("input, textarea, button, select") .prop("disabled", true); @@ -71,16 +76,18 @@ export function maybe_disable_widgets() { .hide(); $(".organization-box [data-name='organization-settings']") - .find(".control-label-disabled") - .addClass("enabled"); + .find("input[type='checkbox']:disabled") + .closest(".input-group") + .addClass("control-label-disabled"); $(".organization-box [data-name='organization-permissions']") .find("input, textarea, button, select") .prop("disabled", true); $(".organization-box [data-name='organization-permissions']") - .find(".control-label-disabled") - .addClass("enabled"); + .find("input[type='checkbox']:disabled") + .closest(".input-group") + .addClass("control-label-disabled"); } export function get_organization_settings_options() { diff --git a/web/src/settings_realm_user_settings_defaults.js b/web/src/settings_realm_user_settings_defaults.js index 4d54298956..8607d27721 100644 --- a/web/src/settings_realm_user_settings_defaults.js +++ b/web/src/settings_realm_user_settings_defaults.js @@ -17,6 +17,11 @@ export function maybe_disable_widgets() { .find("input, select") .prop("disabled", true); + $(".organization-box [data-name='organization-level-user-defaults']") + .find("input[type='checkbox']:disabled") + .closest(".input-group") + .addClass("control-label-disabled"); + $(".organization-box [data-name='organization-level-user-defaults']") .find(".play_notification_sound") .addClass("control-label-disabled");