From ff51e012835c3ce53ae3db90a47c50581ba0304a Mon Sep 17 00:00:00 2001 From: Konrad Gadzina Date: Wed, 2 Aug 2023 14:29:13 +0200 Subject: [PATCH] Add node to decision node with keyboard --- public/Alakazam.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/Alakazam.js b/public/Alakazam.js index ed584a0..13701f6 100644 --- a/public/Alakazam.js +++ b/public/Alakazam.js @@ -595,26 +595,32 @@ export class Alakazam { } else if (!modal.isVisible) { if (event.key == "ArrowDown") { + this.targetConnectionDescription = ''; this.flowchart.selectNextNode(); } else if (event.key == "ArrowLeft") { + this.targetConnectionDescription = ''; this.flowchart.selectNextNode("left"); } else if (event.key == "ArrowRight") { + this.targetConnectionDescription = ''; this.flowchart.selectNextNode("right"); } else if (event.key == "ArrowUp") { + this.targetConnectionDescription = ''; this.flowchart.selectPreviousNode(); } else if (this.flowchart.selectedNode) { this.currentNodeElement = this.flowchart.selectedNode.getNodeElement(); - if (this.flowchart.selectedNode.type == "decision") { + if (this.flowchart.selectedNode.type == "decision" && this.targetConnectionDescription == '') { if (event.key == "y") { - this.performDecisionAction('Yes'); + // this.performDecisionAction('Yes'); + this.targetConnectionDescription = 'Yes'; } else if (event.key == "n") { - this.performDecisionAction('No'); + this.targetConnectionDescription = 'No'; + // this.performDecisionAction('No'); } } else {