3e6f2d19667afbc81cc78d76d4ea08a4540edeed max Fri Oct 4 06:02:36 2024 -0700 only hiding parents when doing "hide all others", refs #23793 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index f7cc4ad..da49ce9 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -2127,61 +2127,72 @@ clickedHighlightIdx : null, // the index (0,1,...) of the highlight item that overlaps the last right-click moveTo : function(id, topOrBottom) { /* move a track to either "top" or "bottom" position */ let newPos = "0.5"; if (topOrBottom==="bottom") { newPos = String(parseInt($(".imgOrd").last().attr("abbr"))+1); } let trEl = $(document.getElementById('tr_' + id)); trEl.attr('abbr', newPos); dragReorder.sort($("#imgTbl")); dragReorder.setOrder($("#imgTbl")); }, - hideTracks: function (ids) + hideTracks: function (ids, hideParent) { var cartVars = []; var cartVals = []; for (var i = 0; i 0 && hgTracks.trackDb) { var title; var rec = hgTracks.trackDb[id]; if (rec) { title = rec.shortLabel; } else { title = id; } @@ -2473,31 +2484,31 @@ async: false, url: "../cgi-bin/hgCollection", data: "cmd=addTrack&track=" + id + "&collection=" + collectionName + "&hgsid=" + getHgsid(), trueSuccess: mySuccess, success: catchErrorOrDispatch, error: errorHandler, }); imageV2.fullReload(); } else if (cmd === "hideOthers") { var hideIds = []; for (var otherId in hgTracks.trackDb) { if (otherId!==id && otherId!=="ruler") hideIds.push(otherId); } - rightClick.hideTracks(hideIds); + rightClick.hideTracks(hideIds, true); } else if (cmd === "moveTop") { rightClick.moveTo(id, "top"); } else if (cmd === "moveBottom") { rightClick.moveTo(id, "bottom"); } else if ((cmd === 'sortExp') || (cmd === 'sortSim')) { url = "hgTracks?hgsid=" + getHgsid() + "&" + cmd + "="; rec = hgTracks.trackDb[id]; if (tdbHasParent(rec) && tdbIsLeaf(rec)) url += rec.parentTrack; else { // The button already has the ref var link2 = normed($( 'td#td_btn_'+ rightClick.selectedMenuItem.id ).children('a')); if (link2) url = $(link2).attr('href'); else @@ -2645,31 +2656,31 @@ updateObj[key] = 1; cart.setVarsObj(updateObj,null,false); imageV2.requestImgUpdate(id, id + ".doMergeItems=1"); } } else { // if ( cmd in 'hide','dense','squish','pack','full','show' ) // Change visibility settings: // // First change the select on our form: rec = hgTracks.trackDb[id]; selectUpdated = vis.update(id, cmd); // Now change the track image if (imageV2.enabled && cmd === 'hide') { // Hide local display of this track and update server side cart. // Subtracks controlled by 2 settings so del vis and set sel=0. - rightClick.hideTracks([id]); + rightClick.hideTracks([id], false); } else if (!imageV2.mapIsUpdateable) { jQuery('body').css('cursor', 'wait'); if (selectUpdated) { // assert(document.TrackForm); document.TrackForm.submit(); } else { // Add vis update to queue then submit cart.setVars([id], [cmd], null, false); // synchronous document.TrackHeaderForm.submit(); } } else { imageV2.requestImgUpdate(id, id + "=" + cmd, "", cmd); } } },