304f3686ff1f77fb5793cd941ca3420a8903545a tdreszer Wed Aug 18 16:50:30 2010 -0700 Find Tracks now has a description only popup diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 6e811ee..eb8bd02 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1487,7 +1487,7 @@ } } else if (cmd == 'hgTrackUi_popup') { - hgTrackUiPopUp( selectedMenuItem.id ); // Launches the popup but shields the ajax with a waitOnFunction + hgTrackUiPopUp( selectedMenuItem.id, false ); // Launches the popup but shields the ajax with a waitOnFunction } else if (cmd == 'hgTrackUi_follow') { @@ -1747,7 +1747,6 @@ function updateTrackImg(trackName) { - jQuery('body').css('cursor', 'wait'); var data = "hgt.trackImgOnly=1&&hgsid=" + getHgsid() + "&hgt.trackNameFilter=" + trackName; $.ajax({ type: "GET", @@ -1762,12 +1761,18 @@ } var popUpTrackName; -function _hgTrackUiPopUp(trackName) +var popUpTrackDescriptionOnly = false; +function _hgTrackUiPopUp(trackName,descriptionOnly) { // popup cfg dialog popUpTrackName = trackName; + var myLink = "../cgi-bin/hgTrackUi?ajax=1&g=" + trackName + "&hgsid=" + getHgsid() + "&db=" + getDb(); + popUpTrackDescriptionOnly = descriptionOnly; + if(popUpTrackDescriptionOnly) + myLink += "&descriptionOnly=1"; + $.ajax({ type: "GET", - url: "../cgi-bin/hgTrackUi?ajax=1&g=" + trackName + "&hgsid=" + getHgsid() + "&db=" + getDb(), + url: myLink, dataType: "html", trueSuccess: handleTrackUi, success: catchErrorOrDispatch, @@ -1776,15 +1781,15 @@ }); } -function hgTrackUiPopUp(trackName) +function hgTrackUiPopUp(trackName,descriptionOnly) { - waitOnFunction( _hgTrackUiPopUp, trackName ); // Launches the popup but shields the ajax with a waitOnFunction + waitOnFunction( _hgTrackUiPopUp, trackName, descriptionOnly ); // Launches the popup but shields the ajax with a waitOnFunction } function handleTrackUi(response, status) { // Take html from hgTrackUi and put it up as a modal dialog. - $('#hgTrackUiDialog').html("
" + response + "
"); + $('#hgTrackUiDialog').html("
" + response + "
"); $('#hgTrackUiDialog').dialog({ ajaxOptions: { // This doesn't work @@ -1795,14 +1800,15 @@ height: 'auto', width: 'auto', minHeight: 200, - minWidth: 400, + minWidth: 700, modal: true, closeOnEscape: true, autoOpen: false, buttons: { "Ok": function() { + if(popUpTrackDescriptionOnly == false) setAllVars($('#pop')); $(this).dialog("close"); - if($('#imgTbl') != undefined) + if($('#imgTbl') != undefined && popUpTrackDescriptionOnly == false) updateTrackImg(popUpTrackName); }}, close: function() { @@ -1810,6 +1816,11 @@ $('#hgTrackUiDialog').html(""); } }); + if(popUpTrackDescriptionOnly) { + var myWidth = $(window).width() - 300; + $('#hgTrackUiDialog').dialog("option", "maxWidth", myWidth); + $('#hgTrackUiDialog').dialog("option", "width", myWidth); + } // Apparently the options above to dialog take only once, so we set title explicitly. $('#hgTrackUiDialog').dialog('option' , 'title' , trackDbJson[popUpTrackName].shortLabel + " Track Settings"); jQuery('body').css('cursor', ''); @@ -2164,3 +2175,4 @@ $("input[name=hgt.addRow]").val(rowNum); return true; } + \ No newline at end of file