fa624caf3e94e4a738016b941718d50b9ed251cf tdreszer Tue Jan 11 13:21:51 2011 -0800 Added support for hiding found files or tracks when switching tabs on search page diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 1ab00c4..e1de7c1 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1295,30 +1295,42 @@ } } if($("#tabs").length > 0) { // Search page specific code var val = $('#currentTab').val(); $("#tabs").tabs({ show: function(event, ui) { $('#currentTab').val(ui.panel.id); }, select: function(event, ui) { if( ui.panel.id == 'simpleTab' && $('div#found').length < 1) { setTimeout("$('input#simpleSearch').focus();",20); // delay necessary, since select event not afterSelect event } + if( $('div#filesFound').length == 1) { + if( ui.panel.id == 'filesTab') + $('div#filesFound').show(); + else + $('div#filesFound').hide(); + } + if( $('div#found').length == 1) { + if( ui.panel.id != 'filesTab') + $('div#found').show(); + else + $('div#found').hide(); + } } }); $('#tabs').show(); $("#tabs").tabs('option', 'selected', '#' + val); if(val =='simpleTab' && $('div#found').length < 1) { $('input#simpleSearch').focus(); } $("#tabs").css('font-family', jQuery('body').css('font-family')); $("#tabs").css('font-size', jQuery('body').css('font-size')); $('.submitOnEnter').keydown(searchKeydown); findTracksNormalize(); updateMetaDataHelpLinks(0); } if(typeof(trackDbJson) != "undefined" && trackDbJson != null) {