diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 9654d26b..7a4124e1 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -182,7 +182,15 @@ function saveToMap() { var nodes_data = "", synapses_data = ""; var synapses_array = new Array(); Mconsole.graph.eachNode(function(n) { - nodes_data += n.id + '/' + n.pos.x + '/' + n.pos.y + ','; + var x, y; + if (n.pos.x && n.pos.y) { + x = n.pos.x; + y = n.pos.y; + } else { + var x = Math.cos(n.pos.theta) * n.pos.rho; + var y = Math.sin(n.pos.theta) * n.pos.rho; + } + nodes_data += n.id + '/' + x + '/' + y + ','; n.eachAdjacency(function(adj) { synapses_array.push(adj.getData("id")); }); diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 89af1524..ced68f64 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -14,23 +14,13 @@ # #%> - +

Viewing Topic: <%= @topic.name %> @@ -53,6 +43,7 @@ <% if authenticated? %> <%= render :partial => 'topics/new' %> - <%= render :partial => 'synapses/new' %> + <%= render :partial => 'synapses/new' %> + <%= render :partial => 'maps/new' %> <% end %>