made it so that the synapse still appears even while you write the description of the connection

This commit is contained in:
Connor Turland 2012-12-21 00:08:52 -05:00
parent 355a6d4d0f
commit c92508d909
2 changed files with 18 additions and 13 deletions

View file

@ -70,7 +70,6 @@ function graphSettings(type) {
else if (e.button == 2) {
if (tempInit == false) {
tempNode = node;
console.log(tempNode);
tempInit = true;
}
//

View file

@ -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 {