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

Adds new mechanic for clearing selection

parent 189dfc93
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
Pipeline #56901 passed
...@@ -177,6 +177,13 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> { ...@@ -177,6 +177,13 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
return; return;
} }
// Just deselect if shift key is pressed
if (this.state.keys["Shift"]) {
this.selectNode(undefined);
return;
}
// Add new node
const newNode = new Node(); const newNode = new Node();
newNode.label = "Unnamed"; newNode.label = "Unnamed";
...@@ -479,6 +486,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> { ...@@ -479,6 +486,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
<hr /> <hr />
<ul className="instructions"> <ul className="instructions">
<li>Click background to create node</li> <li>Click background to create node</li>
<li>SHIFT+Click background to clear selection</li>
<li>Click node to select and edit</li> <li>Click node to select and edit</li>
<li>CTRL+Click node to delete</li> <li>CTRL+Click node to delete</li>
<li>CTRL+Click link to delete</li> <li>CTRL+Click link to delete</li>
...@@ -491,7 +499,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> { ...@@ -491,7 +499,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
"" ""
)} )}
<li>DELETE to delete selected node</li> <li>DELETE to delete selected node</li>
<li>ESCAPE to unselect</li> <li>ESCAPE to clear selection</li>
</ul> </ul>
<hr /> <hr />
<NodeDetails <NodeDetails
......
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