From ab6468cae11a1f94f71826a74eece7ce2290f378 Mon Sep 17 00:00:00 2001 From: Rolux Date: Thu, 18 Feb 2010 20:43:23 +0530 Subject: [PATCH] autocomplete, continued --- build/js/ox.ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 43d282a..a73e417 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -1574,8 +1574,9 @@ requires }); } function autocomplete(items) { - var selected = -1; + var selected; if (items.length) { + selected = items.length == 1 ? 0 : -1; items = $.map(items, function(title, position) { if (that.val().toLowerCase() == title.toLowerCase()) { selected = position;