From a080fa2ec422ae466de1e5da27185e1e03d54469 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 27 Jan 2013 17:58:43 -0500 Subject: [PATCH] now the permissions is broken and it looks bad, but the directionality editing works --- app/assets/javascripts/Jit/graphsettings.js | 2 +- .../Jit/select-edit-delete-nodes-and-edges.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js index 387ac3e8..830e759a 100644 --- a/app/assets/javascripts/Jit/graphsettings.js +++ b/app/assets/javascripts/Jit/graphsettings.js @@ -240,7 +240,7 @@ var nodeSettings = { //plot arrow edge if (directionCat == "none") { - //this.edgeHelper.line.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, canvas); + edgeHelper.line.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, canvas); } else if (directionCat == "both") { renderMidArrow({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 13, true, canvas); diff --git a/app/assets/javascripts/Jit/select-edit-delete-nodes-and-edges.js b/app/assets/javascripts/Jit/select-edit-delete-nodes-and-edges.js index 9c420e57..38045cb0 100644 --- a/app/assets/javascripts/Jit/select-edit-delete-nodes-and-edges.js +++ b/app/assets/javascripts/Jit/select-edit-delete-nodes-and-edges.js @@ -139,7 +139,7 @@ function add_direction_form(edge) { $('#edit_synapse_left').prop('checked', true); $('#edit_synapse_right').prop('checked', true); } - $('edit_synapse_left, #edit_synapse_right').click(function() { + $('#edit_synapse_left, #edit_synapse_right').click(function() { var leftChecked = $('#edit_synapse_left').is(':checked'); var rightChecked = $('#edit_synapse_right').is(':checked'); @@ -149,10 +149,10 @@ function add_direction_form(edge) { dirCat = 'both'; } else if (!leftChecked && rightChecked) { dirCat = 'from-to'; - dir = [left.id, right.id]; + dir = [right.id, left.id]; } else if (leftChecked && !rightChecked) { dirCat = 'from-to'; - dir = [right.id, left.id]; + dir = [left.id, right.id]; } $.ajax({ 'type': 'PUT', @@ -180,7 +180,8 @@ function updateEdgeDisplay(edge, dir, dirCat) { edge.setData('direction', dir); //render mid arrow - renderEdgeArrows(null, edge); + renderEdgeArrows(Mconsole.fx.edgeHelper, edge); + Mconsole.plot(); } function best_in_place_perms(edge) {