Skip to content

Commit ee2349e

Browse files
committed
Revision of the TOS confirmation, no longer using jQuery code for this
1 parent 91299f0 commit ee2349e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

com.woltlab.wcf/templates/paidSubscriptionList.tpl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{capture assign='headContent'}
22
{if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
33
<script data-relocate="true">
4-
$(function() {
5-
$('#tosConfirmed').change(function () {
6-
if ($('#tosConfirmed').is(':checked')) {
7-
$('.paidSubscriptionList button').enable();
8-
}
9-
else {
10-
$('.paidSubscriptionList button').disable();
11-
}
12-
});
13-
$('#tosConfirmed').change();
14-
});
4+
const tosCheckbox = document.getElementById('tosConfirmed');
5+
const buttons = document.querySelectorAll('.paidSubscriptionList button');
6+
if (tosCheckbox) {
7+
function toggleButtons() {
8+
buttons.forEach(function(button) {
9+
button.disabled = !tosCheckbox.checked;
10+
});
11+
}
12+
tosCheckbox.addEventListener('change', toggleButtons);
13+
toggleButtons();
14+
}
1515
</script>
1616

1717
<noscript>

0 commit comments

Comments
 (0)