From f298427ab840a9d242e924e2933b2a277509a5b2 Mon Sep 17 00:00:00 2001 From: Ryan Sobol Date: Fri, 11 Nov 2016 15:51:13 -0800 Subject: [PATCH] Improve the solution --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1f21ae0..f6c279e 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,9 @@ const drawCanvas = function() { return; } - event.target.classList.add(brushClass); + if (brushClass) { + event.target.classList.add(brushClass); + } }); }