Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringGeneral.js,v diff -u -r1.75 -r1.76 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js 5 Feb 2016 09:45:12 -0000 1.75 +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 5 Jul 2016 07:38:08 -0000 1.76 @@ -45,6 +45,8 @@ 'drawMode' : false, // should the sequence be saved before exiting? 'modified' : false, + // was start point of a new branching placed? + 'addBranchingStart' : null, // list of all dialogs, so they can be easily closed all at once 'dialogs' : [], // stores precached tool images so they can be used in exported SVG Index: lams_central/web/includes/javascript/authoring/authoringHandler.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringHandler.js,v diff -u -r1.22 -r1.23 --- lams_central/web/includes/javascript/authoring/authoringHandler.js 8 Jul 2015 14:34:28 -0000 1.22 +++ lams_central/web/includes/javascript/authoring/authoringHandler.js 5 Jul 2016 07:38:08 -0000 1.23 @@ -215,6 +215,17 @@ .off('mouseup') .off('mousemove'); + // if the user started adding a branching and did not finish it + if (layout.addBranchingStart){ + layout.infoDialog.text('').dialog('close'); + + if (layout.addBranchingStart instanceof ActivityDefs.BranchingEdgeActivity) { + layout.activities.splice(layout.activities.indexOf(layout.addBranchingStart), 1); + layout.addBranchingStart.items.remove(); + } + layout.addBranchingStart = null; + } + if (init) { // if clicked anywhere, activity selection is gone canvas.click(HandlerLib.canvasClickHandler) Index: lams_central/web/includes/javascript/authoring/authoringMenu.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringMenu.js,v diff -u -r1.39 -r1.40 --- lams_central/web/includes/javascript/authoring/authoringMenu.js 15 Jul 2015 11:16:42 -0000 1.39 +++ lams_central/web/includes/javascript/authoring/authoringMenu.js 5 Jul 2016 07:38:08 -0000 1.40 @@ -157,6 +157,8 @@ var dialog = layout.infoDialog.text(LABELS.BRANCHING_START_PLACE_PROMPT); dialog.dialog('open'); + layout.addBranchingStart = true; + var branchingActivity = null; canvas.css('cursor', 'pointer').click(function(event){ // pageX and pageY tell event coordinates relative to the whole page @@ -171,6 +173,7 @@ if (branchingActivity) { // converge point was just place, end of function + layout.addBranchingStart = null; HandlerLib.resetCanvasMode(true); dialog.text('').dialog('close'); @@ -179,6 +182,7 @@ } else { // extract main branchingActivity structure from created start point branchingActivity = branchingEdge.branchingActivity; + layout.addBranchingStart = branchingEdge; dialog.text(LABELS.BRANCHING_END_PLACE_PROMPT); } });