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

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

View file

@ -21,7 +21,7 @@
</section> </section>
<section class="tools"> <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="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> <span class="tool-selector" data-tool-name="pointer" title="Point at things, but don't change them.">&#x2739;</span>
</section> </section>