diff --git a/src/project/templates/account/email.html b/src/project/templates/account/email.html index 1dc31e9..5251e26 100644 --- a/src/project/templates/account/email.html +++ b/src/project/templates/account/email.html @@ -17,10 +17,10 @@ {% csrf_token %}
- - - - + + + +
@@ -45,6 +45,7 @@ {% if emailaddress.primary or user.emailaddress_set.count == 1 %} checked="checked" {% endif %} + class="{% if emailaddress.primary %}primary_email{% endif %}" />
@@ -104,6 +105,15 @@ } }); } + + let radio_actions = document.getElementsByName('email'); + if (radio_actions.length) { + for (radio of radio_actions) { + radio.addEventListener("change", function (e) { + document.getElementById('action_primary').disabled = e.target.classList.contains('primary_email') + }); + } + } })();