From 3d86ada4d9d606fc3ae09dbfb7027ab575fe8ff6 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 19 Sep 2018 02:12:04 +0200 Subject: content update --- tools/draw/app.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools/draw/app.js') 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) { document.querySelectorAll('nav button').forEach(function(button, idx) { - button.addEventListener('click', function(evt) { - console.log(button.dataset.method); + if (button.dataset.method == 'color') { + button.style.background = button.dataset.value; + } + + button.addEventListener('click', function(evt) { switch (button.dataset.method) { case 'color': { @@ -65,7 +68,6 @@ window.addEventListener('load', function(evt) { } }); -}); + }); }); - -- cgit v1.2.3