From 0ab627807753dedb8d8de120adfc0b0a58b0cec0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Tue, 7 Aug 2018 19:47:35 +0200 Subject: [PATCH] Enable/Disable element instead of hiding the whole element See #2665 --- wcfsetup/install/files/acp/templates/trophyAdd.tpl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/trophyAdd.tpl b/wcfsetup/install/files/acp/templates/trophyAdd.tpl index 64a9b883be..bbf79fd30a 100644 --- a/wcfsetup/install/files/acp/templates/trophyAdd.tpl +++ b/wcfsetup/install/files/acp/templates/trophyAdd.tpl @@ -32,11 +32,15 @@ var awardAutomatically = elBySel('input[name=awardAutomatically]').checked; elBySelAll('.conditionSection', null, window[(awardAutomatically ? 'elShow' : 'elHide')]); + var revokeCheckbox = elBySel('#revokeAutomaticallyDL input'); if (awardAutomatically) { - elShow(elById('revokeAutomaticallyDL')); + elById('revokeAutomaticallyDL').classList.remove('disabled'); + revokeCheckbox.disabled = false; } else { - elHide(elById('revokeAutomaticallyDL')); + elById('revokeAutomaticallyDL').classList.add('disabled'); + revokeCheckbox.disabled = true; + revokeCheckbox.checked = false; } }); @@ -150,10 +154,10 @@ -