diff options
Diffstat (limited to 'tools/draw/app.js')
| -rw-r--r-- | tools/draw/app.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/draw/app.js b/tools/draw/app.js index 7ddc45d..329a8fc 100644 --- a/tools/draw/app.js +++ b/tools/draw/app.js | |||
| @@ -40,9 +40,12 @@ window.addEventListener('load', function(evt) { | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | document.querySelectorAll('nav button').forEach(function(button, idx) { | 42 | document.querySelectorAll('nav button').forEach(function(button, idx) { |
| 43 | button.addEventListener('click', function(evt) { | ||
| 44 | console.log(button.dataset.method); | ||
| 45 | 43 | ||
| 44 | if (button.dataset.method == 'color') { | ||
| 45 | button.style.background = button.dataset.value; | ||
| 46 | } | ||
| 47 | |||
| 48 | button.addEventListener('click', function(evt) { | ||
| 46 | switch (button.dataset.method) { | 49 | switch (button.dataset.method) { |
| 47 | case 'color': | 50 | case 'color': |
| 48 | { | 51 | { |
| @@ -65,7 +68,6 @@ window.addEventListener('load', function(evt) { | |||
| 65 | } | 68 | } |
| 66 | }); | 69 | }); |
| 67 | 70 | ||
| 68 | }); | 71 | }); |
| 69 | 72 | ||
| 70 | }); | 73 | }); |
| 71 | |||
