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.51.2.37 -r1.51.2.38 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js 8 Jun 2016 11:28:29 -0000 1.51.2.37 +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 5 Jul 2016 07:33:04 -0000 1.51.2.38 @@ -47,6 +47,8 @@ 'liveEdit' : 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' : [], // icons for special activities 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.16.2.7 -r1.16.2.8 --- lams_central/web/includes/javascript/authoring/authoringHandler.js 10 Sep 2015 11:03:43 -0000 1.16.2.7 +++ lams_central/web/includes/javascript/authoring/authoringHandler.js 5 Jul 2016 07:33:04 -0000 1.16.2.8 @@ -221,6 +221,17 @@ .off('mousedown') .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 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.34.2.14 -r1.34.2.15 --- lams_central/web/includes/javascript/authoring/authoringMenu.js 25 Jun 2016 14:39:47 -0000 1.34.2.14 +++ lams_central/web/includes/javascript/authoring/authoringMenu.js 5 Jul 2016 07:33:04 -0000 1.34.2.15 @@ -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 @@ -179,6 +181,7 @@ } else { // extract main branchingActivity structure from created start point branchingActivity = branchingEdge.branchingActivity; + layout.addBranchingStart = branchingEdge; dialog.text(LABELS.BRANCHING_END_PLACE_PROMPT); } });