Skip to content

Commit

Permalink
add undo/redo shortcut and idea selection-indicator to LabyrinthJS
Browse files Browse the repository at this point in the history
While linking ideas, no selection-indicator of selected idea was visible thereby creating confusion.
Added a selection-indicator to the currently selected idea and auto-deselect after making a link.

Signed-off-by: Aayush Raj <[email protected]>
  • Loading branch information
44yu5h committed Apr 6, 2024
1 parent bb07df3 commit 5a1f217
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion activities/LabyrinthJS.activity/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,18 @@ define(["sugar-web/activity/activity", "l10n", "sugar-web/datastore", "sugar-web
if (lastSelected == this) lastSelected = null;
return;
} else if (currentMode == 1) {
if (isSelectedNode(this)) {
unselectNode(this);
lastSelected = null;
}
else { selectNode(this); }
if (lastSelected != null && lastSelected != this) {
createEdge(lastSelected, this);
unselectNode(this);
lastSelected = null;
pushState();
}
lastSelected = this;
if (isSelectedNode(this)) lastSelected = this;
return;
} else {
if (isSelectedNode(this)) {
Expand Down

0 comments on commit 5a1f217

Please sign in to comment.