From 2e0c1a4320d592aa5681ab9b13cbdd4cc5a1619d Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 9 Dec 2012 19:42:45 -0500 Subject: [PATCH] Revert "fixed bug that wasn't letting you save the layout of a map if you had added new synapses to it." This reverts commit 698690effd8e2b421683ab3d2e0a359c4f4965ea. --- app/controllers/synapses_controller.rb | 2 +- app/views/synapses/create.js.erb | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/controllers/synapses_controller.rb b/app/controllers/synapses_controller.rb index 1d0d2225..08ab27dd 100644 --- a/app/controllers/synapses_controller.rb +++ b/app/controllers/synapses_controller.rb @@ -89,7 +89,7 @@ class SynapsesController < ApplicationController respond_to do |format| format.html { respond_with(@user, location: user_synapse_url(@user, @synapse)) } - format.js { respond_with(@synapse, @mapping1, @mapping2) } + format.js { respond_with(@synapse) } end end diff --git a/app/views/synapses/create.js.erb b/app/views/synapses/create.js.erb index 134b9ab4..05a73133 100644 --- a/app/views/synapses/create.js.erb +++ b/app/views/synapses/create.js.erb @@ -18,7 +18,7 @@ if (map1 != null) { mymap = map; } - if (mymap == fd || mymap == rg || mymap == map) { + if (mymap == fd || mymap == rg || mymap = map) { temp1 = mymap.graph.getNode(<%= @synapse.item1.id %>); if (temp1 == null) { newnode = <%= @synapse.item1.self_as_json.html_safe %>; @@ -36,11 +36,6 @@ if (map1 != null) { temp.setPos(new $jit.Polar(5.54, 347.6), 'start'); temp.setPos(new $jit.Polar(5.54, 347.6), 'end'); } - <% unless (@mapping1.nil?) %> - temp.setData('xloc',0); - temp.setData('yloc',0); - temp.setData('mappingid', '<%= @mapping1.id %>'); - <% end %> mymap.fx.plotNode(temp, mymap.canvas); temp1 = mymap.graph.getNode(<%= @synapse.item1.id %>); } @@ -61,11 +56,6 @@ if (map1 != null) { temp.setPos(new $jit.Polar(5.54, 347.6), 'start'); temp.setPos(new $jit.Polar(5.54, 347.6), 'end'); } - <% unless (@mapping2.nil?) %> - temp.setData('xloc',0); - temp.setData('yloc',0); - temp.setData('mappingid', '<%= @mapping2.id %>'); - <% end %> mymap.fx.plotNode(temp, mymap.canvas); temp2 = mymap.graph.getNode(<%= @synapse.item2.id %>); }