fixed console issue

This commit is contained in:
Connor Turland 2013-02-16 19:03:21 -05:00
parent a1c5a82ac4
commit c7f44d34a7
3 changed files with 15 additions and 6 deletions

View file

@ -99,10 +99,11 @@ class TopicsController < ApplicationController
@position['y'] = params[:topic][:y] @position['y'] = params[:topic][:y]
# set this for the case where the topic is being created on a map. # set this for the case where the topic is being created on a map.
@mapping = Mapping.new() @mapping = nil
if params[:topic][:map] if params[:topic][:map]
@map = Map.find(params[:topic][:map]) @map = Map.find(params[:topic][:map])
@mapping = Mapping.new()
@mapping.category = "Topic" @mapping.category = "Topic"
@mapping.user = @user @mapping.user = @user
@mapping.map = @map @mapping.map = @map

View file

@ -2,9 +2,9 @@
* @file * @file
* Javascript called when you create a new synapse. * Javascript called when you create a new synapse.
*/ */
$('#synapse_desc').autocomplete('disable');
$('#new_synapse').fadeOut('fast'); $('#new_synapse').fadeOut('fast');
$('#synapse_desc').attr('value',''); $('#synapse_desc').attr('value','');
$('#synapse_desc').autocomplete('disable');
$('#synapse_topic1id').attr('value','0'); $('#synapse_topic1id').attr('value','0');
$('#synapse_topic2id').attr('value','0'); $('#synapse_topic2id').attr('value','0');

View file

@ -37,7 +37,11 @@ if (!$.isEmptyObject(Mconsole.graph.nodes)) {
else if (gType == "arranged" || gType == "chaotic") { else if (gType == "arranged" || gType == "chaotic") {
temp.setData('xloc',0); temp.setData('xloc',0);
temp.setData('yloc',0); temp.setData('yloc',0);
temp.setData('mappingid', '<%= @mapping.id %>'); <% if not @mapping.nil? %>
temp.setData('mappingid', <%= @mapping.id %>);
<% elsif @mapping.nil? %>
temp.setData('mappingid', null);
<% end %>
temp.setPos(new $jit.Complex(x, y), 'current'); temp.setPos(new $jit.Complex(x, y), 'current');
temp.setPos(new $jit.Complex(x, y), 'start'); temp.setPos(new $jit.Complex(x, y), 'start');
temp.setPos(new $jit.Complex(x, y), 'end'); temp.setPos(new $jit.Complex(x, y), 'end');
@ -81,8 +85,12 @@ if (!$.isEmptyObject(Mconsole.graph.nodes)) {
temp.setData('dim', 25, 'end'); temp.setData('dim', 25, 'end');
temp.setData('onCanvas', false); temp.setData('onCanvas', false);
temp.setData('inCommons', false); temp.setData('inCommons', false);
if ((gType == "arranged" || gType == "chaotic") && mapid != null) { if (gType == "arranged" || gType == "chaotic") {
<% if not @mapping.nil? %>
temp.setData('mappingid', <%= @mapping.id %>); temp.setData('mappingid', <%= @mapping.id %>);
<% elsif @mapping.nil? %>
temp.setData('mappingid', null);
<% end %>
} }
temp.setPos(new $jit.Complex(x, y), 'current'); temp.setPos(new $jit.Complex(x, y), 'current');
temp.setPos(new $jit.Complex(x, y), 'start'); temp.setPos(new $jit.Complex(x, y), 'start');