Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Auto-toggle other radio button if other email input is focused or typ…
Browse files Browse the repository at this point in the history
…ed in. Fixes bug #1050989.
  • Loading branch information
jezdez committed Aug 13, 2014
1 parent 03f5fe7 commit 6d94af8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion kuma/users/templates/socialaccount/signup.html
Expand Up @@ -72,7 +72,7 @@ <h1>{{ _('Sign up') }}</h1>
<li>
{% if email_choice.choice_value == form.other_email_value %}
{{ email_choice.tag() }}
<label for="{{ id_for_label }}" class="inner">{% trans %}other:{% endtrans %}</label>
<label for="{{ id_for_label }}" class="inner other-label">{% trans %}other:{% endtrans %}</label>
{{ form.other_email }}
{% else %}
<label for="{{ id_for_label }}">
Expand Down Expand Up @@ -105,3 +105,19 @@ <h1>{{ _('Sign up') }}</h1>
</div>
</section>
{% endblock %}

{% block js %}
<script>
(function (jQuery) {
'use strict';

var $otherLabel = $('.other-label');
var $otherRadio = $otherLabel.prev();
$otherLabel.next().on('keyup focus', function() {
$otherRadio.prop("checked", true);
})

})(jQuery);
</script>

{% endblock %}

0 comments on commit 6d94af8

Please sign in to comment.