changed savedToMap() function so that it also includes all synapses

This commit is contained in:
Devin Howard 2013-01-07 22:05:59 -05:00
parent a7d4debd02
commit e2c408f983

View file

@ -115,16 +115,19 @@ function saveLayout(id) {
// this is to save your console to a map // this is to save your console to a map
function saveToMap() { function saveToMap() {
var Coor = ""; var nodes_data = "", syapses_data = "";
Mconsole.graph.eachNode(function(n) { Mconsole.graph.eachNode(function(n) {
Coor = Coor + n.id + '/' + n.pos.x + '/' + n.pos.y + ','; nodes_data += n.id + '/' + n.pos.x + '/' + n.pos.y + ',';
}); });
Coor = Coor.slice(0, -1); Mconsole.graph.eachAdjacence(function(adj) {
$('#map_topicsToMap').val(Coor); synapses_data += adj.id + ',';
}
nodes_data = nodes_data.slice(0, -1);
$('#map_topicsToMap').val(nodes_data);
$('#map_synapsesToMap').val(synapses_data);
$('#new_map').fadeIn('fast'); $('#new_map').fadeIn('fast');
} }
// this is for hiding one topic from your canvas // this is for hiding one topic from your canvas
function removeFromCanvas(topic_id) { function removeFromCanvas(topic_id) {
var node = Mconsole.graph.getNode(topic_id); var node = Mconsole.graph.getNode(topic_id);
@ -168,4 +171,4 @@ function MconsoleReset() {
var mY = Mconsole.canvas.scaleOffsetY; var mY = Mconsole.canvas.scaleOffsetY;
Mconsole.canvas.scale((1/mX),(1/mY)); Mconsole.canvas.scale((1/mX),(1/mY));
} }