4bcb97b7a5d90ca87653dd0f40f32d949dc225ed larrym Thu Jun 9 11:42:14 2011 -0700 code to update just the imgTbl in response to navigation buttons; currently live only in larrym's tree diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 34a7983..8b48cdd 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -2360,106 +2360,144 @@ if(myWidth > 900) myWidth = 900; $('#hgTrackUiDialog').dialog("option", "maxWidth", myWidth); $('#hgTrackUiDialog').dialog("option", "width", myWidth); $('#hgTrackUiDialog').dialog('option' , 'title' , trackDbJson[popUpTrackName].shortLabel + " Track Description"); $('#hgTrackUiDialog').dialog('open'); var buttOk = $('button.ui-state-default'); if($(buttOk).length == 1) $(buttOk).focus(); } else { $('#hgTrackUiDialog').dialog('option' , 'title' , trackDbJson[popUpTrackName].shortLabel + " Track Settings"); $('#hgTrackUiDialog').dialog('open'); } } +function afterImgTblReload() +{ +// Reload various UI widgets after updating imgTbl map. + 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(); + reloadFloatingItem(); +} + +function updateTrackImgForId(html, id) +{ +// update row in imgTbl for given id. +// return true if we successfully pull slice for id and update it in imgTrack. + var str = "]*>([\\s\\S]+?)"; + var reg = new RegExp(str); + var a = reg.exec(html); + if(a && a[1]) { + $('#tr_' + id).html(a[1]); + // NOTE: Want to examine the png? Uncomment: + //var img = $('#tr_' + id).find("img[id^='img_data_']").attr('src'); + //warn("Just parsed image:
"+img); + return true; + } else { + return false; + } +} + function handleUpdateTrackMap(response, status) { // Handle ajax response with an updated trackMap image (gif or png) and map. // // this.cmd can be used to figure out which menu item triggered this. -// -// e.g.: +// this.id == appropriate track if we are retrieving just a single track. + // Parse out new ideoGram url (if available) + // e.g.: var a = /]+SRC[^>]+id='chrom'[^>]*)>/.exec(response); if(a && a[1]) { b = /SRC\s*=\s*"([^")]+)"/.exec(a[1]); if(b[1]) { $('#chrom').attr('src', b[1]); } } + // update local trackDbJson to reflect possible side-effects of ajax request. var re = /<\!-- trackDbJson -->\n