b86f0ec66b0578d803262c72b427b5b21bb750aa
tdreszer
  Mon Dec 13 10:26:17 2010 -0800
Fixed obscure bug where map area had no COORDS.  FF on Linux prevented rightClick occasionally because of this.
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 6fe4af5..c8e8ec4 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -1866,38 +1866,40 @@
         });
     return;
 }
 
 function parseMap(ele, reset)
 {
 // Parse the jQuery <map> object into returned mapItems array (ele needn't be the element attached to current document).
         if(reset || !mapItems) {
             mapItems = new Array();
         }
         if(ele) {
                 var i = mapItems.length;
                 // src is necessary under msie
                 var src = ele.next().attr('src');
                 ele.children().each(function() {
+                    if (this.coords != undefined) {
                                       mapItems[i++] = {
                                           r : new Rectangle(this.coords),
                                           href : this.href,
                                           title : this.title,
                                           id : this.id,
                                           src : src,
                                           obj : this
                                       };
+                    }
                                   });
     }
     return mapItems;
 }
 
 function updateTrackImg(trackName,extraData,loadingId)
 {
     var data = "hgt.trackImgOnly=1&hgsid=" + getHgsid() + "&hgt.trackNameFilter=" + trackName;
     if(extraData != undefined && extraData != "")
         data += "&" + extraData;
     if(loadingId == undefined || loadingId == "")
         loadingId = showLoadingImage("tr_" + trackName);
     $.ajax({
                 type: "GET",
                 url: "../cgi-bin/hgTracks",
@@ -2087,30 +2089,33 @@
           var reg = new RegExp(str);
           a = reg.exec(response);
           if(a && a[1]) {
 //               $('#tr_' + id).html();
 //               $('#tr_' + id).empty();
                $('#tr_' + id).html(a[1]);
                // XXXX move following to a shared method
                parseMap(null, true);
                $("map[name!=ideoMap]").each( function(t) { parseMap($(this, false));});
                initImgTblButtons();
                loadImgAreaSelect(false);
                // Do NOT reload context menu (otherwise we get the "context menu sticks" problem).
                // loadContextMenu($('#tr_' + id));
                if(trackImgTbl.tableDnDUpdate)
                    trackImgTbl.tableDnDUpdate();
+               // NOTE: Want to examine the png? Uncomment:
+               //var img = $('#tr_' + id).find("img[id^='img_data_']").attr('src');
+               //warn("Just parsed image:<BR>"+img);
           } else {
                showWarning("Couldn't parse out new image for id: " + id);
                //alert("Couldn't parse out new image for id: " + id+"BR"+response);  // Very helpful
           }
     } else {
         if(imageV2) {
             a= /<TABLE id=\'imgTbl\'[^>]*>([\S\s]+?)<\/TABLE>/.exec(response);
             if(a[1]) {
                 // This doesn't work (much weirdness ensues).
                 $('#imgTbl').html(a[1]);
             } else {
                 showWarning("Couldn't parse out new image");
             }
         } else {
             a= /<IMG([^>]+SRC[^>]+id='trackMap[^>]*)>/.exec(response);