6f284ddc082d3077bf66f7053855f57d1d31ece1
tdreszer
  Fri Jun 3 16:52:38 2011 -0700
Changed labels for right-click hide sets options.
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 3a99fb2..86d931c 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -1897,64 +1897,66 @@
             popUpBoxCleanup();   // Popup box is not getting closed properly so must do it here
 
             var menu = [];
             var selectedImg = makeImgTag("greenChecksm.png");
             var blankImg    = makeImgTag("invisible16.png");
             var done = false;
             if(selectedMenuItem && selectedMenuItem.id != null) {
                 var href = selectedMenuItem.href;
                 var isHgc, isGene;
                 if(href) {
                     isGene = href.match("hgGene");
                     isHgc = href.match("hgc");
                 }
                 var id = selectedMenuItem.id;
                 var rec = trackDbJson[id];
-                var offerHideSet       = false;
+                var offerHideSubset    = false;
                 var offerHideComposite = false;
                 var row = $( 'tr#tr_' + id );
                 if (row) {
                     var btn = $(row).find('p.btnBlue');  // btnBlue means cursor over left button
                     if (btn.length == 1) {
-                        var contiguousSet = imgTblContiguousRowSet(row);
-                        if (contiguousSet && contiguousSet.length > 1) {// There is a contiguous set
-                            offerHideSet = true;
-                            $( contiguousSet ).addClass("greenRows"); // green persists
-                        }
                         var compositeSet = imgTblCompositeSet(row);
                         if (compositeSet && compositeSet.length > 0) {  // There is a composite set
                             offerHideComposite = true;
                             $( compositeSet ).find('p.btn').addClass('blueButtons');  // blue persists
-                            if (contiguousSet && contiguousSet.length == compositeSet.length)
-                                offerHideSet = false; // no need to offer both
+
+                            var subSet = imgTblContiguousRowSet(row);
+                            if (subSet && subSet.length > 1 && subSet.length < compositeSet.length) {
+                                offerHideSubset = true;
+                                $( subSet ).addClass("greenRows"); // green persists
+                            }
                         }
                     }
                 }
 
                 // First option is hide whole set
-                if (offerHideSet) {
+                if (offerHideComposite) {
+                    if (offerHideSubset) {
                     var o = new Object();
-                    o[blankImg + " hide highlighted (green) set"] = {onclick: makeContextMenuHitCallback('hideSet')};
+                        o[blankImg + " hide track subset (green)"] = {onclick: makeContextMenuHitCallback('hideSet')};
                     menu.push(o);
                 }
-                if (offerHideComposite) {
+
                     var o = new Object();
-                    o[blankImg + " hide track (blue) set"] = {onclick: makeContextMenuHitCallback('hideComposite')};
+                    var str = blankImg + " hide track set";
+                    if (offerHideSubset)
+                        str += " (blue)";
+                    o[str] = {onclick: makeContextMenuHitCallback('hideComposite')};
                     menu.push(o);
-                }
-                if (offerHideSet || offerHideComposite)
                     menu.push($.contextMenu.separator);
+                }
 
                 // XXXX what if select is not available (b/c trackControlsOnMain is off)?
                 // Move functionality to a hidden variable?
                 var select = $("select[name=" + id + "]");
                 if (select.length > 1)  // Not really needed if $('#hgTrackUiDialog').html(""); has worked
                     select =  [ $(select)[0] ];
                 var cur = $(select).val();
                 if(cur) {
                     $(select).children().each(function(index, o) {
                                                var title = $(this).val();
                                                var str = blankImg + " " + title;
                                                if(title == cur)
                                                    str = selectedImg + " " + title;
                                                var o = new Object();
                                                o[str] = {onclick: function (menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, title); return true;}};
