more onCanvas/inCommons => whiteCircle/greenCircle changes in views. Also changed a thing in main/search.js.erb about the "temp" node being undefined instead of null that may fix an issue or not

This commit is contained in:
Devin Howard 2013-03-14 21:01:09 -04:00
parent 610286cee7
commit 1c3aa6c973
2 changed files with 11 additions and 12 deletions

View file

@ -19,8 +19,8 @@ var even = true;
var temp = Mconsole.graph.getNode('<%= topic.id %>');
temp.setData('dim', 1, 'start');
temp.setData('dim', 25, 'end');
temp.setData('inCommons',true);
temp.setData('onCanvas',false);
temp.setData('greenCircle',true);
temp.setData('whiteCircle',false);
temp.setPos(new $jit.Complex(myX, myY), 'current');
temp.setPos(new $jit.Complex(myX, myY), 'start');
temp.setPos(new $jit.Complex(myX, myY), 'end');
@ -28,17 +28,16 @@ var even = true;
Mconsole.labels.plotLabel(Mconsole.canvas, temp, Mconsole.config);
myX += 100;
even = !even;
}
else {
} else {
var temp = Mconsole.graph.getNode('<%= topic.id %>');
if (temp == null || temp.getData('inCommons')) {
if (temp == undefined) {
var newnode = <%= topic.self_as_json.html_safe %>;
Mconsole.graph.addNode(newnode);
var temp = Mconsole.graph.getNode('<%= topic.id %>');
temp.setData('dim', 1, 'start');
temp.setData('dim', 25, 'end');
temp.setData('inCommons',true);
temp.setData('onCanvas',false);
temp.setData('greenCircle',true);
temp.setData('whiteCircle',false);
if (myX > (w-100)) {
myX = -w + 400;
myY += 200;
@ -85,7 +84,7 @@ var even = true;
username: '<%= synapse.user.name %>',
permission: '<%= synapse.permission %>'
});
temp.data.$direction = d;
temp.setData('direction', d);
Mconsole.fx.plotLine(temp, Mconsole.canvas);
}
<% end %>

View file

@ -25,8 +25,8 @@ if (!$.isEmptyObject(Mconsole.graph.nodes)) {
var temp = Mconsole.graph.getNode('<%= @topic.id %>');
temp.setData('dim', 1, 'start');
temp.setData('dim', 40, 'end');
temp.setData('onCanvas', false);
temp.setData('inCommons', false);
temp.setData('whiteCircle', false);
temp.setData('greenCircle', false);
if (gType == "centered") {
var tempPos = new $jit.Complex(x, y);
@ -84,8 +84,8 @@ if (!$.isEmptyObject(Mconsole.graph.nodes)) {
var temp = Mconsole.graph.getNode('<%= @topic.id %>');
temp.setData('dim', 1, 'start');
temp.setData('dim', 25, 'end');
temp.setData('onCanvas', false);
temp.setData('inCommons', false);
temp.setData('whiteCircle', false);
temp.setData('greenCircle', false);
if (gType == "arranged" || gType == "chaotic") {
<% if not @mapping.nil? %>
temp.setData('mappingid', <%= @mapping.id %>);