1
0
Fork 0

[client] Add to interface

This commit is contained in:
Starbeamrainbowlabs 2017-04-27 21:53:07 +01:00
parent e1f2b2910a
commit 903fe26af9
2 changed files with 4 additions and 3 deletions

View File

@ -10,8 +10,9 @@ class Interface extends EventEmitter
this.sidebar = inSidebar;
this.currentToolElement = this.sidebar.querySelector(".tools .tool-selector[]")
this.currentToolElement = this.sidebar.querySelector(".tools .tool-selector[data-selected]");
this.currentTool = "brush";
this.setupToolSelectors();
}
setupToolSelectors()
@ -33,7 +34,7 @@ class Interface extends EventEmitter
this.currentToolElement = event.target;
this.currentToolElement.dataset.selected = "yes";
this.currentTool = this.currentToolElement.dataset.toolName;
console.info("Selected tool", this.currentTool);
this.emit("toolchange", { newTool: this.currentTool });
}

View File

@ -21,7 +21,7 @@
</section>
<section class="tools">
<span class="tool-selector" data-tool-name="pencil" title="Draw lines with a brush." data-selected>&#x1f58c;</span>
<span class="tool-selector" data-tool-name="brush" title="Draw lines with a brush." data-selected>&#x1f58c;</span>
<span class="tool-selector" data-tool-name="pan" title="Pan around the plane.">&harr;</span>
<span class="tool-selector" data-tool-name="pointer" title="Point at things, but don't change them.">&#x2739;</span>
</section>