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:
parent
e1f2b2910a
commit
903fe26af9
2 changed files with 4 additions and 3 deletions
|
@ -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 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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>🖌</span>
|
<span class="tool-selector" data-tool-name="brush" title="Draw lines with a brush." data-selected>🖌</span>
|
||||||
<span class="tool-selector" data-tool-name="pan" title="Pan around the plane.">↔</span>
|
<span class="tool-selector" data-tool-name="pan" title="Pan around the plane.">↔</span>
|
||||||
<span class="tool-selector" data-tool-name="pointer" title="Point at things, but don't change them.">✹</span>
|
<span class="tool-selector" data-tool-name="pointer" title="Point at things, but don't change them.">✹</span>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue