dbcef757ddcec1fa52c7f0cd58e1ca1ab448c384 larrym Thu Jul 21 15:02:23 2011 -0700 add some comments and code cleanup diff --git src/hg/js/utils.js src/hg/js/utils.js index 9aa493c..d86b867 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -1043,42 +1043,45 @@ var msecs = interatingFunc(args); if (msecs > 0) ro.step(msecs,args); // recursion else if (msecs == 0) continuingFunc(args); // completion // else (msec < 0) // abandon }); ro.step(1,args); // kick-off } function showLoadingImage(id) { // Show a loading image above the given id; return's id of div added (so it can be removed when loading is finished). // This code was mostly directly copied from hgHeatmap.js, except I also added the "overlay.appendTo("body");" var loadingId = id + "LoadingOverlay"; + // make an opaque overlay to partially hide the image var overlay = $("<div></div>").attr("id", loadingId).css("position", "absolute"); overlay.appendTo("body"); overlay.css("top", $('#'+ id).position().top); var divLeft = $('#'+ id).position().left + 2; overlay.css("left",divLeft); var width = $('#'+ id).width() - 5; var height = $('#'+ id).height(); overlay.width(width); overlay.height(height); overlay.css("background", "white"); overlay.css("opacity", 0.75); - var imgLeft = (width / 2) - 110; + // now add the overlay image itself in the center of the overlay. + var imgWidth = 220; // hardwired based on width of loading.gif + var imgLeft = (width / 2) - (imgWidth / 2); var imgTop = (height / 2 ) - 10; $("<img src='../images/loading.gif'/>").css("position", "relative").css('left', imgLeft).css('top', imgTop).appendTo(overlay); return loadingId; } function hideLoadingImage(id) { $('#' + id).remove(); } function codonColoringChanged(name) { // Updated disabled state of codonNumbering checkbox based on current value of track coloring select. var val = $("select[name='" + name + ".baseColorDrawOpt'] option:selected").text(); $("input[name='" + name + ".codonNumbering']").attr('disabled', val == "OFF");