Skip to content

Commit

Permalink
Rev for 1.2.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Kirda committed Feb 8, 2013
1 parent 3264901 commit 0add15e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
19 changes: 10 additions & 9 deletions dist/jquery.autocomplete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Ajax Autocomplete for jQuery, version 1.2.3
* Ajax Autocomplete for jQuery, version 1.2.4
* (c) 2013 Tomas Kirda
*
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
Expand Down Expand Up @@ -89,6 +89,7 @@
onSearchComplete: noop,
containerClass: 'autocomplete-suggestions',
tabDisabled: false,
dataType : 'text',
lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
},
Expand Down Expand Up @@ -179,7 +180,7 @@

// Listen for click event on suggestions list:
container.on('click', suggestionSelector, function () {
that.select($(this).data('index'));
that.select($(this).data('index'), false);
});

that.fixPosition();
Expand Down Expand Up @@ -243,7 +244,7 @@
}

offset = that.el.offset();

$(that.suggestionsContainer).css({
top: (offset.top + that.el.outerHeight()) + 'px',
left: offset.left + 'px'
Expand Down Expand Up @@ -297,7 +298,7 @@
that.hide();
return;
}
that.select(that.selectedIndex);
that.select(that.selectedIndex, e.keyCode === keys.RETURN);
if (e.keyCode === keys.TAB && this.options.tabDisabled === false) {
return;
}
Expand Down Expand Up @@ -359,7 +360,7 @@
return;
}

if (q === '' || q.length < that.options.minChars) {
if (q.length < that.options.minChars) {
that.hide();
} else {
that.getSuggestions(q);
Expand Down Expand Up @@ -406,7 +407,7 @@
url: options.serviceUrl,
data: options.params,
type: options.type,
dataType: 'text'
dataType: options.dataType
}).done(function (txt) {
that.processResponse(txt);
options.onSearchComplete.call(that.element, q);
Expand Down Expand Up @@ -476,7 +477,7 @@

processResponse: function (text) {
var that = this,
response = $.parseJSON(text);
response = typeof text == 'string' ? $.parseJSON(text) : text;

response.suggestions = that.verifySuggestionsFormat(that.options.transformResult(response));

Expand Down Expand Up @@ -515,13 +516,13 @@
return null;
},

select: function (i) {
select: function (i, shouldIgnoreNextValueChange) {
var that = this,
selectedValue = that.suggestions[i];

if (selectedValue) {
that.el.val(selectedValue);
that.ignoreValueChange = true;
that.ignoreValueChange = shouldIgnoreNextValueChange;
that.hide();
that.onSelect(i);
}
Expand Down
35 changes: 18 additions & 17 deletions dist/jquery.autocomplete.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/jquery.autocomplete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Ajax Autocomplete for jQuery, version 1.2.3
* Ajax Autocomplete for jQuery, version 1.2.4
* (c) 2013 Tomas Kirda
*
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
Expand Down

0 comments on commit 0add15e

Please sign in to comment.