mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
72ccdff5a0
The current label for giving a funding goal contains a text field to enter the amount. Since this is a radio input, and the label for this radio option contains the text input, (that is, since the text field is the label) clicking on the text field is the same as clicking on the label... switching focus to the radio input on FX and IE. This prevents people from entering in a value. The typical way to do this is to actually separate the input from the label and using javascript to 'check' the radio when the field is clicked or otherwise updated (by keyboard.) This change adds that javascript. It will select the radio option when the text field or the surrounding text is clicked. It will also select the radio option if the text field is tabbed-to and updated (if no mouse is used.) When no javascript is available, it will not select the radio option. The user will have to click on the radio option first. Another method would be to disable the text field until the radio option is selected.
27 lines
1.0 KiB
HTML
27 lines
1.0 KiB
HTML
{% extends "participant.html" %}
|
|
{% block head2 %}
|
|
<script src="/assets/{{ __version__ }}/profile.js"></script>
|
|
{% if user.ADMIN %}<script src="/assets/{{ __version__ }}/admin.js"></script>{% end %}
|
|
<script>$(document).ready(Gittip.initTipButtons)</script>
|
|
<script>$(document).ready(function() {
|
|
$('#goal-custom').on('click change', function() {
|
|
$('#goal-yes').attr('checked', true)
|
|
})
|
|
})</script>
|
|
{% end %}
|
|
|
|
{% block heading %}<h2 class="top"><span>{{ hero }}</span></h2>{% end %}
|
|
|
|
{% block nav %}
|
|
{% if participant.id == user.id or user.ADMIN %}
|
|
<div class="nav level-2">
|
|
<h2>Navigation</h2>
|
|
{% set current_page = path.raw.split('/')[2] %}
|
|
{% set pages = [('/', 'Profile'), ('/giving/', 'Giving'), ('/history/', 'History'), ('/widgets/', 'Widgets')] %}
|
|
{% for slug, name in pages %}
|
|
<a href="/{{ participant.id }}{{ slug }}"><button{% if slug.strip('/') == current_page %} class="selected"{% end %}>{{ name }}</button></a>
|
|
{% end %}
|
|
</div>
|
|
{% end %}
|
|
{% end %}
|