Skip to content

Commit

Permalink
Bug 612586, fixed addon autocomplete handling
Browse files Browse the repository at this point in the history
  • Loading branch information
potch committed Nov 17, 2010
1 parent ed50b92 commit 86992c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Expand Up @@ -24,9 +24,9 @@ <h3>{{ _('Add-ons in Your Collection') }}</h3>
<tr>
<td colspan="4" class="input">
<input id="addon-ac" placeholder="{{ _('Enter the name of the add-on to include') }}" class="long placeholder" data-src="{{ url('search.ajax') }}" />
<button id="addon-select">
<a class="button" href="#" id="addon-select">
{{ _('Add to Collection') }}
</button>
</a>
</td>
</tr>
{% for addon in addons %}
Expand Down
9 changes: 8 additions & 1 deletion media/js/zamboni/collections.js
Expand Up @@ -402,7 +402,14 @@ if (addon_ac.length) {
};
}

$('#addon-select').click(function() {
$('#addon-ac').keydown(function(e) {
if (e.which == 13) {
e.preventDefault();
$('#addon-select').click();
}
});
$('#addon-select').click(function(e) {
e.preventDefault();
var id = $('#addon-ac').attr('data-id');
var name = $('#addon-ac').val();
var icon = $('#addon-ac').attr('data-icon');
Expand Down

0 comments on commit 86992c9

Please sign in to comment.