f19fae5927f272b3678a87dcd53dd2705a735e4b
larrym
  Mon Feb 7 17:32:42 2011 -0800
resize related code (redmine #2633); code is currently only used in larrym's tree
diff --git src/hg/js/utils.js src/hg/js/utils.js
index 751061b..a29d915 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -1618,15 +1618,33 @@
     }
 
     // Finally, make visible
     $(tbody).removeClass('sorting');
     $(tbody).show();
 }
 
 function setCheckboxList(list, value)
 {
 // set value of all checkboxes in semicolon delimited list
     var names = list.split(";");
     for(var i=0;i<names.length;i++) {
         $("input[name='" + names[i] + "']").attr('checked', value);
     }
 }
+
+function calculateHgTracksWidth()
+{
+// return appropriate width for hgTracks image given users current window width
+    return $(window).width() - 20;
+}
+
+function hgTracksSetWidth()
+{
+    var winWidth = calculateHgTracksWidth();
+    if($("#imgTbl").length == 0) {
+        // XXXX what's this code for?
+        $("#TrackForm").append('<input type="hidden" name="pix" value="' + winWidth + '"/>');
+        //$("#TrackForm").submit();
+    } else {
+        $("input[name=pix]").val(winWidth);
+    }
+}