[FIXED JENKINS-22674] Use JS to resize graph.

This will make the load statistics graphs fit the window width.
This commit is contained in:
Daniel Beck committed 2014-04-18 13:55:33 +02:00
1 parent dcfeaf3c2a
commit 33e8a8ff00
1 file changed
+8 -2
@@ -58,8 +58,14 @@ THE SOFTWARE.
${%Long}
</j:otherwise>
</j:choose>
</div>
<img src="${prefix?:'loadStatistics'}/graph?type=${type}&amp;width=500&amp;height=300" alt="[${%Load statistics graph}]" />
</div>
<script type="text/javascript">
var w = document.getElementById('main-panel').offsetWidth - 30;
document.write('<img src="${prefix?:'loadStatistics'}/graph?type=${type}&amp;width=' + w + '&amp;height=500" alt="[${%Load statistics graph}]" />');
</script>
<noscript>
<img src="${prefix?:'loadStatistics'}/graph?type=${type}&amp;width=500&amp;height=300" alt="[${%Load statistics graph}]" />
</noscript>
<div style="margin-top: 2em;">
${%blurb}
</div>