File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 281
281
topOverflow = - scrollTop + offset . top - containerHeight ,
282
282
bottomOverflow = scrollTop + viewPortHeight - ( offset . top + height + containerHeight ) ;
283
283
284
- orientation = ( Math . max ( topOverflow , bottomOverflow ) === topOverflow )
285
- ? 'top'
286
- : 'bottom' ;
284
+ orientation = ( Math . max ( topOverflow , bottomOverflow ) === topOverflow ) ? 'top' : 'bottom' ;
287
285
}
288
286
289
287
if ( orientation === 'top' ) {
388
386
that . selectHint ( ) ;
389
387
return ;
390
388
}
391
- // Fall through to RETURN
389
+ /* falls through */
392
390
case keys . RETURN :
393
391
if ( that . selectedIndex === - 1 ) {
394
392
that . hide ( ) ;
616
614
617
615
suggest : function ( ) {
618
616
if ( this . suggestions . length === 0 ) {
619
- this . options . showNoSuggestionNotice ? this . noSuggestions ( ) : this . hide ( ) ;
617
+ if ( this . options . showNoSuggestionNotice ) {
618
+ this . noSuggestions ( ) ;
619
+ } else {
620
+ this . hide ( ) ;
621
+ }
620
622
return ;
621
623
}
622
624
860
862
861
863
adjustScroll : function ( index ) {
862
864
var that = this ,
863
- activeItem = that . activate ( index ) ,
864
- offsetTop ,
865
- upperBound ,
866
- lowerBound ,
867
- heightDelta = 25 ;
865
+ activeItem = that . activate ( index ) ;
868
866
869
867
if ( ! activeItem ) {
870
868
return ;
871
869
}
872
870
871
+ var offsetTop ,
872
+ upperBound ,
873
+ lowerBound ,
874
+ heightDelta = $ ( activeItem ) . outerHeight ( ) ;
875
+
873
876
offsetTop = activeItem . offsetTop ;
874
877
upperBound = $ ( that . suggestionsContainer ) . scrollTop ( ) ;
875
878
lowerBound = upperBound + that . options . maxHeight - heightDelta ;
You can’t perform that action at this time.
0 commit comments