Browse Source

fix re-draw button

master
Fr3deric 6 years ago
parent
commit
4f9b41de20
  1. 10
      chaostest/connected-lines.html

10
chaostest/connected-lines.html

@ -28,6 +28,8 @@ function get_svg() { @@ -28,6 +28,8 @@ function get_svg() {
window.onload = function() {
paper.install(window);
paper.setup(document.getElementById('canvas'));
var editor;
rnd_params();
draw();
@ -40,11 +42,13 @@ window.onload = function() { @@ -40,11 +42,13 @@ window.onload = function() {
a.click();
});
document.getElementById('draw').addEventListener('click', function() {
document.getElementById('new').addEventListener('click', function() {
rnd_params();
editor.setValue(params);
draw();
});
var editor = new JSONEditor(document.getElementById('params'), {
editor = new JSONEditor(document.getElementById('params'), {
no_additional_properties: true,
disable_edit_json: true,
disable_properties: true,
@ -102,7 +106,7 @@ window.onload = function() { @@ -102,7 +106,7 @@ window.onload = function() {
<canvas id="canvas" style="width: 500px; height: 500px;" resize></canvas>
<hr>
<button id="download-svg">download svg</button>
<button id="draw">draw</button>
<button id="new">new</button>
<br>
<div id="params"></div>

Loading…
Cancel
Save