Layout: fixed autocomplete box position

This commit is contained in:
Marcin Kurczewski 2013-11-25 21:51:31 +01:00
parent f226c3eb0c
commit 7820417188

View file

@ -19,7 +19,7 @@ function getCookie(name)
return null; return null;
start = value.indexOf('=', start) + 1; start = value.indexOf('=', start) + 1;
var end = value.indexOf(";", start); var end = value.indexOf(';', start);
if (end == -1) if (end == -1)
end = value.length; end = value.length;
@ -211,14 +211,19 @@ $(function()
var searchInput = $(this); var searchInput = $(this);
searchInput searchInput
// don't navigate away from the field on tab when selecting an item // don't navigate away from the field on tab when selecting an item
.bind("keydown", function(event) .bind('keydown', function(event)
{ {
if (event.keyCode === $.ui.keyCode.TAB && $(this).data("autocomplete").menu.active) if (event.keyCode === $.ui.keyCode.TAB && $(this).data('autocomplete').menu.active)
{ {
event.preventDefault(); event.preventDefault();
} }
}).autocomplete({ }).autocomplete({
minLength: 1, minLength: 1,
position:
{
my: 'right top',
at: 'right bottom'
},
source: function(request, response) source: function(request, response)
{ {
var term = extractLast(request.term); var term = extractLast(request.term);