Skip to content

Commit

Permalink
Do not attach autocomplete handler if datalist is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Jan 11, 2017
1 parent a550380 commit e22b4bc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions client/galaxy/scripts/mvc/ui/ui-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ define(['utils/utils',
.attr( 'type', this.model.get( 'type' ) )
.attr( 'placeholder', this.model.get( 'placeholder' ) )
.css( 'color', this.model.get( 'color' ) || '' )
.css( 'border-color', this.model.get( 'color' ) || '' )
.autocomplete( { source : function( request, response ) { response( self.model.get( 'datalist' ) ) } } );
.css( 'border-color', this.model.get( 'color' ) || '' );
if ( self.model.get( 'datalist' ) ) {
this.$el.autocomplete( { source : function( request, response ) { response( self.model.get( 'datalist' ) ) } } );
}
if ( this.model.get( 'value' ) !== this.$el.val() ) {
this.$el.val( this.model.get( 'value' ) );
}
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/ui/ui-misc.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/mvc/ui/ui-misc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e22b4bc

Please sign in to comment.