a84d62e802c63ca0dcf0d3043f2cd39ca40d683b
tdreszer
  Tue Oct 5 13:12:48 2010 -0700
Added paging to findTracks and icons to findTracks and icons
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 7531e90..0495f53 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -1747,18 +1747,27 @@
                     var any = false;
                     if(isGene || isHgc) {
                         var title = selectedMenuItem.title || "feature";
-                        o["Zoom to " +  title] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "selectWholeGene"); return true; }};
-                        o["Get DNA for " +  title] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "getDna"); return true; }};
-                        o["Open details page in new window"] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "openLink"); return true; }};
+                        o["<img src='../images/magnify.png' /> Zoom to " +  title] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "selectWholeGene"); return true; }};
+                        o["<img src='../images/dnaIcon.png' /> Get DNA for " +  title] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "getDna"); return true; }};
+                        o["<img src='../images/bookOut.png' /> Open details page in new window..."] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "openLink"); return true; }};
                         any = true;
                     }
                     if(selectedMenuItem.title != undefined && selectedMenuItem.title.length > 0
                     && selectedMenuItem.href  != undefined && selectedMenuItem.href.length  > 0) {
-                        if(selectedMenuItem.title.indexOf("Click to alter") != 0 || selectedMenuItem.title.indexOf("and similar subtracks") != -1) {
-                        o[selectedMenuItem.title] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "followLink"); return true; }};
+                        var str = selectedMenuItem.title;
+                        var set = false;
+                        if(str.indexOf("Click to alter ") == 0)
+                            str = "Alter " + str.substring("Click to alter ".length);
+                        if(str.indexOf(" and similar subtracks") != -1)
+                            set = true;
+                            //str = str.substring(0,str.length - " and similar subtracks".length);
+                        if(str.indexOf("display density") != -1)
+                            str = "<img src='../images/toggle.png' /> " + str;
+                        else
+                            str = "<img src='../images/book.png' /> Show details for " + str + "...";
+                        o[str] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "followLink"); return true; }};
                         any = true;
                     }
-                    }
                     if(any) {
                         menu.push($.contextMenu.separator);
                         menu.push(o);
@@ -1793,18 +1802,18 @@
             // Add cfg options at just shy of end...
             var o = new Object();
             if(tdbIsLeaf(rec)) {
-                o["configure "+rec.shortLabel] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "hgTrackUi_popup"); return true; }};
+                o["<img src='../images/wrench.png' /> Configure "+rec.shortLabel] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "hgTrackUi_popup"); return true; }};
                 if(rec.parentTrack != undefined)
-                    o["configure "+rec.parentLabel+" track set..."] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "hgTrackUi_follow"); return true; }};
+                    o["<img src='../images/folderWrench.png' /> Configure "+rec.parentLabel+" track set..."] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "hgTrackUi_follow"); return true; }};
             } else
-                o["configure "+rec.shortLabel+" track set..."] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "hgTrackUi_follow"); return true; }};
+                o["<img src='../images/folderWrench.png' /> Configure "+rec.shortLabel+" track set..."] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "hgTrackUi_follow"); return true; }};
             menu.push($.contextMenu.separator);
             menu.push(o);
                 menu.push($.contextMenu.separator);
             }
 
             // Add view image at end
-            menu.push({"view image": {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "viewImg"); return true; }}});
+            menu.push({"<img src='../images/view.png' /> View image": {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "viewImg"); return true; }}});
 
             return menu;
         },
@@ -2374,6 +2383,16 @@
     return true;
 }
 
+function findTracksPage(pageVar,startAt)
+{// Called by radio button to sort tracks
+    if( $('pageIt').length == 0 )
+        $('form#searchTracks').append("<input TYPE=HIDDEN id='pageIt' name='"+pageVar+"' value="+startAt+">");
+    else
+        $('pageIt').val(startAt);
+    $('#searchSubmit').click();
+    return false;
+}
+
 /////////////////////////////////////////////////////
 
 function delSearchSelect(obj, rowNum)