Add some comments to the code
This commit is contained in:
@@ -106,6 +106,8 @@
|
|||||||
|
|
||||||
query = ( this.$element.val() || '' ).trim().toLowerCase();
|
query = ( this.$element.val() || '' ).trim().toLowerCase();
|
||||||
|
|
||||||
|
// Check if a language is currently highlighted, and if so select that
|
||||||
|
// if user presses enter.
|
||||||
var highlightedLanguage = this.options.lcd.getHighlightedLanguageCode();
|
var highlightedLanguage = this.options.lcd.getHighlightedLanguageCode();
|
||||||
if ( highlightedLanguage ) {
|
if ( highlightedLanguage ) {
|
||||||
this.options.onSelect( highlightedLanguage, e );
|
this.options.onSelect( highlightedLanguage, e );
|
||||||
|
|||||||
@@ -150,6 +150,7 @@
|
|||||||
var $selectedItem = $listItems.eq( this.navigationIndex );
|
var $selectedItem = $listItems.eq( this.navigationIndex );
|
||||||
$selectedItem.addClass( 'language-option--highlighted' );
|
$selectedItem.addClass( 'language-option--highlighted' );
|
||||||
|
|
||||||
|
// If the selected item is not visible, then scroll the container to display it
|
||||||
if ( !isLanguageFullyVisible( $selectedItem, this.$element ) ) {
|
if ( !isLanguageFullyVisible( $selectedItem, this.$element ) ) {
|
||||||
$selectedItem.get( 0 ).scrollIntoView( false );
|
$selectedItem.get( 0 ).scrollIntoView( false );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user