diff --git a/static/scripts/galaxy.tools.js b/static/scripts/galaxy.tools.js index b1606682c9b..0c1e41253e9 100644 --- a/static/scripts/galaxy.tools.js +++ b/static/scripts/galaxy.tools.js @@ -68,6 +68,7 @@ define([ "libs/underscore", "mvc/tools" ], function( _, Tools ) { var view = this; var index = 0; + var visibleCount = 0; _.each( this.switchOptions, function( option, onValue ) { var numValues = _.size( option.options ); var selectionType = SELECTION_TYPE[ onValue ]; @@ -79,15 +80,21 @@ define([ "libs/underscore", "mvc/tools" ], function( _, Tools ) { hidden = true; } if( ! hidden ) { - var button = $('').click(function() { + visibleCount++; + var button = $('').click(function() { view.enableSelectBy( iIndex, onValue ); }).attr( 'title', selectionType['select_by'] ); - view.formRow().find( "label" ).append( button ); + view.formRow().find( "label" ).append( button ); } }); + if( visibleCount < 2 ) { + // Don't show buttons to switch options... + view.formRow().find("i.runOptionIcon").hide(); + } + if( defaultIndex != null) { view.enableSelectBy( defaultIndex, defaultOption ); }