Skip to content

Commit 2c6bb91

Browse files
author
Tomas Kirda
committed
Rev for 1.2.15 release
1 parent 805b45c commit 2c6bb91

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devbridge-autocomplete",
3-
"version": "1.2.14",
3+
"version": "1.2.15",
44
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
55
"authors": [
66
"Tomas Kirda"

devbridge-autocomplete.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ajax",
77
"autocomplete"
88
],
9-
"version": "1.2.14",
9+
"version": "1.2.15",
1010
"author": {
1111
"name": "Tomas Kirda",
1212
"url": "https://github.com/tkirda"

dist/jquery.autocomplete.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2-
* Ajax Autocomplete for jQuery, version 1.2.14
2+
* Ajax Autocomplete for jQuery, version 1.2.15
33
* (c) 2014 Tomas Kirda
44
*
55
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
66
* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
77
*/
88

9-
/*jslint browser: true, white: true, plusplus: true */
10-
/*global define, window, document, jQuery, exports */
9+
/*jslint browser: true, white: true, plusplus: true, vars: true */
10+
/*global define, window, document, jQuery, exports, require */
1111

1212
// Expose plugin as an AMD module if AMD loader is present:
1313
(function (factory) {
@@ -265,8 +265,9 @@
265265
containerParent = $container.parent().get(0);
266266
// Fix position automatically when appended to body.
267267
// In other cases force parameter must be given.
268-
if (containerParent !== document.body && !that.options.forceFixPosition)
268+
if (containerParent !== document.body && !that.options.forceFixPosition) {
269269
return;
270+
}
270271

271272
// Choose orientation
272273
var orientation = that.options.orientation,
@@ -275,7 +276,7 @@
275276
offset = that.el.offset(),
276277
styles = { 'top': offset.top, 'left': offset.left };
277278

278-
if (orientation == 'auto') {
279+
if (orientation === 'auto') {
279280
var viewPortHeight = $(window).height(),
280281
scrollTop = $(window).scrollTop(),
281282
topOverflow = -scrollTop + offset.top - containerHeight,
@@ -386,17 +387,22 @@
386387
that.selectHint();
387388
return;
388389
}
389-
/* falls through */
390-
case keys.RETURN:
391390
if (that.selectedIndex === -1) {
392391
that.hide();
393392
return;
394393
}
395394
that.select(that.selectedIndex);
396-
if (e.which === keys.TAB && that.options.tabDisabled === false) {
395+
if (that.options.tabDisabled === false) {
397396
return;
398397
}
399398
break;
399+
case keys.RETURN:
400+
if (that.selectedIndex === -1) {
401+
that.hide();
402+
return;
403+
}
404+
that.select(that.selectedIndex);
405+
break;
400406
case keys.UP:
401407
that.moveUp();
402408
break;
@@ -535,8 +541,8 @@
535541
return;
536542
}
537543

538-
if ($.isFunction(that.lookup)){
539-
that.lookup(q, function (data) {
544+
if ($.isFunction(options.lookup)){
545+
options.lookup(q, function (data) {
540546
that.suggestions = data.suggestions;
541547
that.suggest();
542548
options.onSearchComplete.call(that.element, q, data.suggestions);

dist/jquery.autocomplete.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devbridge-autocomplete",
3-
"version": "1.2.14",
3+
"version": "1.2.15",
44
"description": "Autocomplete provides suggestions while you type into the text field.",
55
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
66
"author": "Tomas Kirda (https://twitter.com/tkirda)",

0 commit comments

Comments
 (0)