Skip to content
Snippets Groups Projects
Commit 98337097 authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Generalized isActive Property to all tools

parent 4f6b3470
No related branches found
No related tags found
No related merge requests found
Pipeline #52773 passed
...@@ -19,14 +19,6 @@ export default class DeleteTool extends Tool { ...@@ -19,14 +19,6 @@ export default class DeleteTool extends Tool {
} }
} }
onToolActivate() {
this.isActive = true;
}
onToolDeactivate(nextTool) {
this.isActive = false;
}
onBoxSelect(left, bottom, top, right) { onBoxSelect(left, bottom, top, right) {
// Filter out selected nodes // Filter out selected nodes
const hitNodes = []; const hitNodes = [];
......
...@@ -6,6 +6,7 @@ export default class Tool { ...@@ -6,6 +6,7 @@ export default class Tool {
this.warnings = false; this.warnings = false;
this.menu = menu; this.menu = menu;
this.toggleBehaviour = toggleBehaviour; this.toggleBehaviour = toggleBehaviour;
this.isActive = false;
if (this.menu !== undefined) { if (this.menu !== undefined) {
this.menu.loadTool(this); this.menu.loadTool(this);
...@@ -31,6 +32,7 @@ export default class Tool { ...@@ -31,6 +32,7 @@ export default class Tool {
} }
activateTool() { activateTool() {
this.isActive = true;
if (this.menu !== undefined) { if (this.menu !== undefined) {
this.menu.show(); this.menu.show();
} }
...@@ -39,6 +41,7 @@ export default class Tool { ...@@ -39,6 +41,7 @@ export default class Tool {
} }
deactivateTool(nextTool) { deactivateTool(nextTool) {
this.isActive = false;
this.onToolDeactivate(nextTool); this.onToolDeactivate(nextTool);
if (this.menu !== undefined) { if (this.menu !== undefined) {
......
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