From 2a0720186e29275fdffe6ac47d1d1e4d7bdcb685 Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Fri, 20 Sep 2024 18:29:33 +0900 Subject: [PATCH] Fix details --- src/web/dialog.html | 2 +- src/web/dialog.js | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/web/dialog.html b/src/web/dialog.html index d5672e3..65342a0 100644 --- a/src/web/dialog.html +++ b/src/web/dialog.html @@ -13,7 +13,7 @@ -
+

登録済みドメインのメールアドレス

全てチェック diff --git a/src/web/dialog.js b/src/web/dialog.js index 11d7456..2555a8a 100644 --- a/src/web/dialog.js +++ b/src/web/dialog.js @@ -105,19 +105,10 @@ function onCancel() { // eslint-disable-next-line @typescript-eslint/no-unused-vars function checkboxChanged(target_element) { const checkTargetLength = $("fluent-checkbox.check-target").length; - let checkedTargetLength = $("fluent-checkbox.check-target.checked").length; + const checkedTargetLength = $("fluent-checkbox.check-target.checked").length; // If the target is currently checked, the target is unchecked after this function and vice versa. - const is_currently_checked = $(target_element).hasClass('checked'); - - if (is_currently_checked) - { - checkedTargetLength -= 1; - } - else - { - checkedTargetLength += 1; - } - const hasUnchecked = checkTargetLength !== checkedTargetLength; + const adjustmentValue = $(target_element).hasClass('checked') ? -1 : 1; + const hasUnchecked = checkTargetLength !== (checkedTargetLength + adjustmentValue); $("#ok-button").prop("disabled", hasUnchecked); }