From 40ee6cecca33557af483d24ab47f448bcc9a26dd Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 6 Oct 2017 15:26:02 +0100 Subject: [PATCH] [client] Fix selection of tools with mouse after icon addition --- Nibriboard/ClientFiles/Interface.js | 4 ++-- Nibriboard/ClientFiles/Nibri.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Nibriboard/ClientFiles/Interface.js b/Nibriboard/ClientFiles/Interface.js index 8e6f845..261c021 100644 --- a/Nibriboard/ClientFiles/Interface.js +++ b/Nibriboard/ClientFiles/Interface.js @@ -36,7 +36,7 @@ class Interface extends EventEmitter toolSelectors[i].addEventListener("touchend", this.handleSelectTool.bind(this)); this.boardWindow.keyboard.on(`keyup-${i + 1}`, (function(toolId, event) { this.handleSelectTool({ - target: this.sidebar.querySelector(`.tools .tool-selector:nth-child(${toolId})`) + currentTarget: this.sidebar.querySelector(`.tools .tool-selector:nth-child(${toolId})`) }); }).bind(this, i + 1)); } @@ -80,7 +80,7 @@ class Interface extends EventEmitter { let oldTool = this.currentToolElement.dataset.toolName; delete this.currentToolElement.dataset.selected; - this.currentToolElement = event.target; + this.currentToolElement = event.currentTarget; this.currentToolElement.dataset.selected = "yes"; this.currentTool = this.currentToolElement.dataset.toolName; console.info("Selected tool", this.currentTool); diff --git a/Nibriboard/ClientFiles/Nibri.css b/Nibriboard/ClientFiles/Nibri.css index dca895e..09176f5 100644 --- a/Nibriboard/ClientFiles/Nibri.css +++ b/Nibriboard/ClientFiles/Nibri.css @@ -106,6 +106,7 @@ hr { border: 0.2em dashed hsl(219, 87%, 54%); } +.tool-selector > img { max-width: 1.25em; } .palette-colour {