From c92508d909a94a7a359cf0458e0bcd839defa551 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Fri, 21 Dec 2012 00:08:52 -0500 Subject: [PATCH] made it so that the synapse still appears even while you write the description of the connection --- app/assets/javascripts/Jit/graphsettings.js | 1 - app/views/items/create.js.erb | 30 ++++++++++++--------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js index 1e6d6da2..cc2e7618 100644 --- a/app/assets/javascripts/Jit/graphsettings.js +++ b/app/assets/javascripts/Jit/graphsettings.js @@ -70,7 +70,6 @@ function graphSettings(type) { else if (e.button == 2) { if (tempInit == false) { tempNode = node; - console.log(tempNode); tempInit = true; } // diff --git a/app/views/items/create.js.erb b/app/views/items/create.js.erb index 9dd6587b..0e47e7d0 100644 --- a/app/views/items/create.js.erb +++ b/app/views/items/create.js.erb @@ -39,23 +39,29 @@ if (Mconsole != null) { temp.setPos(new $jit.Complex(x, y), 'end'); } - Mconsole.fx.plotNode(temp, Mconsole.canvas); - Mconsole.fx.animate({ - modes: ['node-property:dim'], - duration: 400 - }); - if ( '<%= @synapse %>' == "true" ) { - renderMidArrow({ x: tempNode.pos.x, y: tempNode.pos.y }, { x: temp.pos.x, y: temp.pos.y }, 13, false, Mconsole.canvas); - Mconsole.fx.plotNode(tempNode, Mconsole.canvas); - Mconsole.fx.plotNode(temp, Mconsole.canvas); $('#synapse_item1id').val(tempNode.id); $('#synapse_item2id').val(temp.id); $('#new_synapse').fadeIn('fast'); $('#synapse_desc').focus(); - tempNode = null; - tempNode2 = null; - tempInit = false; + Mconsole.fx.animate({ + modes: ['node-property:dim'], + duration: 500, + onComplete: function() { + renderMidArrow({ x: tempNode.pos.x, y: tempNode.pos.y }, { x: temp.pos.x, y: temp.pos.y }, 13, false, Mconsole.canvas); + Mconsole.fx.plotNode(tempNode, Mconsole.canvas); + Mconsole.fx.plotNode(temp, Mconsole.canvas); + tempNode = null; + tempNode2 = null; + tempInit = false; + } + }); + } else { + Mconsole.fx.plotNode(temp, Mconsole.canvas); + Mconsole.fx.animate({ + modes: ['node-property:dim'], + duration: 500 + }); } } else {