4ce8707b784cb61309e09d1da3f7c3ef283064d1
tdreszer
  Mon Sep 13 10:49:30 2010 -0700
Right click view image must use regen a non-imageV2 image, due to conditional centerLabels in imageV2, among other things.
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 642352d..5298cd8 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -1584,7 +1584,7 @@
     } else if (cmd == 'viewImg') {
         // Fetch a new copy of track img and show it to the user in another window. This code assume we have updated
         // remote cart with all relevant chages (e.g. drag-reorder).
-        var data = "hgt.trackImgOnly=1&hgsid=" + getHgsid();
+        var data = "hgt.imageV1=1&hgt.trackImgOnly=1&hgsid=" + getHgsid();
         jQuery('body').css('cursor', 'wait');
         $.ajax({
                    type: "GET",
@@ -2070,19 +2070,15 @@
 }
 
 function handleViewImg(response, status)
-{
+{ // handles view image response, which must get new image without imageV2 gimmickery
     jQuery('body').css('cursor', '');
-    for (var id in trackDbJson) {
-        // Use an arbitrary id to pull out a src from the track image table;
-        // e.g.: <IMG id='img_data_knownGene' src='../trash/hgt/hgt_hgwdev_larrym_479c_abde90.png' ...>
-        var str = "<IMG[^>]*id='img_data_" + id + "'[^>]*src='([^']+)'";
+    var str = "<IMG[^>]*SRC='([^']+)'";
         var reg = new RegExp(str);
         a = reg.exec(response);
         if(a && a[1]) {
             window.open(a[1]);
             return;
         }
-    }
     showWarning("Couldn't parse out img src");
 }