add toggle to hide sidebar
s-ol
5 years ago
60 | 60 |
|
61 | 61 |
</script>
|
62 | 62 |
|
63 | |
|
64 | 63 |
<table align="center">
|
65 | 64 |
<tbody><tr>
|
66 | 65 |
|
67 | 66 |
<td valign="top">
|
68 | 67 |
<canvas id="crtCanvas" width="584" height="584" style="z-index: 0;"></canvas>
|
69 | 68 |
<div id="canvasFailure" style="position: relative; z-index: 1; font:25px arial; top:-40px; color:lightgreen;"></div>
|
70 | |
</td>
|
71 | |
<td width="360" valign="top">
|
|
69 |
<a href="javascript:toggleVisible('sidebar');">toggle sidebar</a>
|
|
70 |
</td>
|
|
71 |
<td id="sidebar" width="360" valign="top">
|
72 | 72 |
|
73 | 73 |
<p style="font-size:5px;"> </p>
|
74 | 74 |
|
302 | 302 |
|
303 | 303 |
var UI =
|
304 | 304 |
{
|
305 | |
sidebarWidth : 360,
|
306 | |
|
307 | 305 |
init : function()
|
308 | 306 |
{
|
309 | 307 |
var kHzText = (AudioSystem.sampleRate/1000).toFixed(1)+"kHz";
|
|
313 | 311 |
this.xInput = document.getElementById("xInput");
|
314 | 312 |
this.yInput = document.getElementById("yInput");
|
315 | 313 |
this.xInput.value = controls.xExpression;
|
316 | |
this.yInput.value = controls.yExpression;
|
|
314 |
this.yInput.value = controls.yExpression;
|
|
315 |
this.sidebar = document.getElementById("sidebar");
|
317 | 316 |
},
|
318 | 317 |
|
319 | 318 |
compile : function() //doesn't compile anything anymore
|
|
465 | 464 |
{
|
466 | 465 |
var windowWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
|
467 | 466 |
var windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
|
468 | |
var canvasSize = Math.min(windowHeight-21, windowWidth-UI.sidebarWidth-70);
|
|
467 |
var canvasSize = Math.min(windowHeight-21, windowWidth - UI.sidebar.getBoundingClientRect().width - 70);
|
469 | 468 |
Render.canvas.width = canvasSize;
|
470 | 469 |
Render.canvas.height = canvasSize;
|
471 | 470 |
if (Render.lineTexture)
|