From a6efd4ee303d0777b060bc1223d96850f1ffae9e Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 6 Oct 2014 16:39:48 +0200 Subject: [PATCH] Fix syntax for jsHint Fixed some lines or changed some code to validate the code against jsHint. See http://www.jshint.com/. Thanks for the good work. --- src/jquery.autocomplete.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index c4864db9..b7e8b700 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -281,9 +281,7 @@ topOverflow = -scrollTop + offset.top - containerHeight, bottomOverflow = scrollTop + viewPortHeight - (offset.top + height + containerHeight); - orientation = (Math.max(topOverflow, bottomOverflow) === topOverflow) - ? 'top' - : 'bottom'; + orientation = (Math.max(topOverflow, bottomOverflow) === topOverflow) ? 'top' : 'bottom'; } if (orientation === 'top') { @@ -388,7 +386,7 @@ that.selectHint(); return; } - // Fall through to RETURN + /* falls through */ case keys.RETURN: if (that.selectedIndex === -1) { that.hide(); @@ -607,7 +605,11 @@ suggest: function () { if (this.suggestions.length === 0) { - this.options.showNoSuggestionNotice ? this.noSuggestions() : this.hide(); + if (this.options.showNoSuggestionNotice) { + this.noSuggestions(); + } else { + this.hide(); + } return; } @@ -851,7 +853,7 @@ adjustScroll: function (index) { var that = this, - activeItem = that.activate(index) + activeItem = that.activate(index); if (!activeItem) { return;