From 4f9b41de20bdfd5dd85e42c206fb795d6426a485 Mon Sep 17 00:00:00 2001 From: Frederic Date: Tue, 23 Apr 2019 12:05:56 +0200 Subject: [PATCH] fix re-draw button --- chaostest/connected-lines.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chaostest/connected-lines.html b/chaostest/connected-lines.html index 7be22e4..bb6c0f7 100644 --- a/chaostest/connected-lines.html +++ b/chaostest/connected-lines.html @@ -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() { 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() {
- +