1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[client] Fix selection of tools with mouse after icon addition

This commit is contained in:
Starbeamrainbowlabs 2017-10-06 15:26:02 +01:00
parent f52665ee6d
commit 40ee6cecca
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -106,6 +106,7 @@ hr
{
border: 0.2em dashed hsl(219, 87%, 54%);
}
.tool-selector > img { max-width: 1.25em; }
.palette-colour
{