Skip to content
Snippets Groups Projects
Commit 287f4369 authored by Maximilian Giller's avatar Maximilian Giller
Browse files

Separated icon from key

parent a4851820
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ class Display { ...@@ -49,7 +49,7 @@ class Display {
tool.getName() + tool.getName() +
'"><img src="' + '"><img src="' +
TOOL_ICON_SRC + TOOL_ICON_SRC +
tool.getKey() + tool.getIcon() +
TOOL_ICON_FORMAT + TOOL_ICON_FORMAT +
'"></button>' '"></button>'
); );
......
class CollectTool extends Tool { class CollectTool extends Tool {
constructor(key) { constructor(key) {
super("Collect", key); super("Collect", "collect", key);
} }
onNodeClick(node) { onNodeClick(node) {
......
class DeleteTool extends Tool { class DeleteTool extends Tool {
constructor(key) { constructor(key) {
super("Delete", key); super("Delete", "delete", key);
} }
onNodeClick(node) { onNodeClick(node) {
......
class SelectTool extends Tool { class SelectTool extends Tool {
constructor(key) { constructor(key) {
super("Select", key); super("Select", "select", key);
} }
onNodeClick(node) { onNodeClick(node) {
......
class Tool { class Tool {
constructor(name, key) { constructor(name, icon, key) {
this.name = name; this.name = name;
this.icon = icon;
this.key = key; this.key = key;
this.warnings = false; this.warnings = false;
} }
...@@ -13,6 +14,10 @@ class Tool { ...@@ -13,6 +14,10 @@ class Tool {
return this.key; return this.key;
} }
getIcon() {
return this.icon;
}
onNodeClick(node) { onNodeClick(node) {
if (this.warnings) { if (this.warnings) {
console.warn('Method "onNodeClick" not implemented.'); console.warn('Method "onNodeClick" not implemented.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment