Skip to content

Commit 05a337c

Browse files
author
Tomas Kirda
committed
Make jshint happy.
1 parent 587414b commit 05a337c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/jquery.autocomplete.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
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;

0 commit comments

Comments
 (0)