6973440613177762ca6434fa91d3d276b4190c01 chmalee Fri Feb 17 13:38:00 2023 -0800 Woops need to build the list of downloadable tracks each time the button is clicked, not just the first time. Also ignore tracks with vis 0, refs #30024 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index d0ecf9b..df034c5 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -5237,57 +5237,30 @@ // wait for the request to complete before making the download file downloadCurrentTrackData.intervalId = setInterval(downloadCurrentTrackData.makeDownloadFile, 200, apiUrl); }, showDownloadUi: function() { // Populate the dialog with the current list of tracks // and allow the user to select which ones to download // Grey out tracks that are currently unsupported by the api // or are protected data var downloadDialog = $("#downloadDialog")[0]; if (!downloadDialog) { downloadDialog = document.createElement("div"); downloadDialog.id = "downloadDialog"; downloadDialog.style = "display: none"; - htmlStr = "

Use this selection window to download track data" + - " for the current region (" + genomePos.get() + "). Please note that large regions" + - " may be slow to download.

"; - htmlStr += "
" + - " " + - "" + - "
"; - _.each(hgTracks.trackDb, function(track, trackName) { - if (trackName !== "ruler") { - htmlStr += ""; - htmlStr += ""; - htmlStr += ""; - htmlStr += "
"; - } - }); - htmlStr += "
"; - htmlStr += ""; - htmlStr += "
"; - htmlStr += ""; - htmlStr += ""; - htmlStr += "
"; - downloadDialog.innerHTML = htmlStr; document.body.append(downloadDialog); $("#checkAllDownloadTracks").click( function() { $(".downloadTrackName").each(function(i, elem) { elem.checked = true; }); }); $("#uncheckAllDownloadTracks").click( function() { $(".downloadTrackName").each(function(i, elem) { elem.checked = false; }); }); var popMaxHeight = ($(window).height() - 40); var popMaxWidth = ($(window).width() - 40); var popWidth = 700; if (popWidth > popMaxWidth) @@ -5300,30 +5273,57 @@ $(downloadDialog).dialog({ title: "Download track data in view", resizable: true, // Let scroll vertically height: 'auto', width: popWidth, minHeight: 200, minWidth: 400, maxHeight: popMaxHeight, maxWidth: popMaxWidth, modal: true, closeOnEscape: true, autoOpen: false, buttons: downloadTrackDataButtons }); } + htmlStr = "

Use this selection window to download track data" + + " for the current region (" + genomePos.get() + "). Please note that large regions" + + " may be slow to download.

"; + htmlStr += "
" + + " " + + "" + + "
"; + _.each(hgTracks.trackDb, function(track, trackName) { + if (trackName !== "ruler" && track.visibility > 0) { + htmlStr += ""; + htmlStr += ""; + htmlStr += ""; + htmlStr += "
"; + } + }); + htmlStr += "
"; + htmlStr += ""; + htmlStr += "
"; + htmlStr += ""; + htmlStr += ""; + htmlStr += "
"; + downloadDialog.innerHTML = htmlStr; $(downloadDialog).dialog('open'); } }; /////////////// //// READY //// /////////////// $(document).ready(function() { imageV2.moveTiming(); // hg.conf will turn this on 2020-10 - Hiram if (window.mouseOverEnabled) { mouseOver.addListener(); }