e6777c3234d0f6bd780e5bade71232b7837d30e7 larrym Wed Mar 16 15:39:02 2011 -0700 remove some experimental code; don't bother to retreive an updated track image if user hasn't change anything in configuration dialog diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 376bf0e..0fa0053 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1688,54 +1688,30 @@ } else if (cmd == 'float') { if(floatingMenuItem && floatingMenuItem == id) { $.floatMgr.FOArray = new Array(); floatingMenuItem = null; } else { if(floatingMenuItem) { // This doesn't work. $('#img_data_' + floatingMenuItem).parent().restartFloat(); // This does work $.floatMgr.FOArray = new Array(); } floatingMenuItem = id; reloadFloatingItem(); updateTrackImg(id, "hgt.transparentImage=0", ""); } - } else if (cmd == 'locateItem') { - // currently experimental - // o["Locate item" ] = {onclick: function(menuItemClicked, menuObject) { contextMenuHit(menuItemClicked, menuObject, "locateItem"); return true; }}; - $('#hgLookupDialog').dialog({ - resizable: false, - height: 'auto', - width: 'auto', - modal: true, - closeOnEscape: true, - autoOpen: false, - buttons: { "OK": function() { - $(this).dialog("close"); - }} - }); - // this doesn't work (not sure why). - $('input#itemLookupSuggest').autocomplete({ - delay: 500, - minLength: 2, - source: ajaxGet(function () {return db;}, new Object), - select: function (event, ui) { - setPosition(ui.item.id, commify(getSizeFromCoordinates(ui.item.id))); - } - }); - $('#hgLookupDialog').dialog('open'); } else { // if( cmd in 'hide','dense','squish','pack','full','show' ) // Change visibility settings: // // First change the select on our form: var rec = trackDbJson[id]; var selectUpdated = updateVisibility(id, cmd); // Now change the track image if(imageV2 && cmd == 'hide') { // Hide local display of this track and update server side cart. // Subtracks controlled by 2 settings so del vis and set sel=0. Others, just set vis hide. if(tdbIsSubtrack(rec)) setCartVars( [ id, id+"_sel" ], [ '[]', 0 ] ); // Remove subtrack level vis and explicitly uncheck. else if(tdbIsFolderContent(rec)) @@ -2109,38 +2085,40 @@ setVarsFromHash(changedVars); //if(hide) // TODO: When findTracks or config page has cfg popup, then vis change needs to be handled in page here } else { // On image page if(hide) { setVarsFromHash(changedVars); $('#tr_' + trackName).remove(); initImgTblButtons(); loadImgAreaSelect(false); } else { // Keep local state in sync if user changed visibility if(newVis != null) { updateVisibility(trackName, newVis); } var urlData = varHashToQueryString(changedVars); + if(urlData.length > 0) { if(mapIsUpdateable) { updateTrackImg(trackName,urlData,""); } else { window.location = "../cgi-bin/hgTracks?" + urlData + "&hgsid=" + getHgsid(); } } } } +} function handleTrackUi(response, status) { // Take html from hgTrackUi and put it up as a modal dialog. // make sure all links (e.g. help links) open up in a new window response = response.replace(/<a /ig, "<a target='_blank' "); // TODO: Shlurp up any javascript files from the response and load them with $.getScript() // example <script type='text/javascript' SRC='../js/tdreszer/jquery.contextmenu-1296177766.js'></script> var cleanHtml = response; var shlurpPattern=/\<script type=\'text\/javascript\' SRC\=\'.*\'\>\<\/script\>/gi; var jsFiles = cleanHtml.match(shlurpPattern); cleanHtml = cleanHtml.replace(shlurpPattern,""); shlurpPattern=/\<script type=\'text\/javascript\'>.*\<\/script\>/gi;