From ca6431176733dba2074ecb6871e3352e79f354c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Wed, 24 Oct 2018 17:37:17 +0200 Subject: [PATCH] js/ui/custom.js: allow deletion of brushes w/ + LMB. --- js/ui/custom.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/ui/custom.js b/js/ui/custom.js index a758d48..c021679 100644 --- a/js/ui/custom.js +++ b/js/ui/custom.js @@ -9,9 +9,14 @@ var custom = (function(){ new_brush.append(rapper) custom_rapper.appendChild(rapper) // store in localstorage? - rapper.addEventListener("click", function(){ - // load this brush - exports.load(new_brush) + rapper.addEventListener("click", function(e){ + if (e.shiftKey) { + rapper.parentNode.removeChild(rapper) + delete new_brush + } else { + // load this brush + exports.load(new_brush) + } }) }