save and load netmap positions for same device groups
This commit is contained in:
		| @@ -40,11 +40,12 @@ $.getJSON('[% uri_for('/ajax/data/device/netmap') %]', {q: '[% params.q %]'}, fu | ||||
|     graph.inspect().main.force.on('end.setupfornetdisco', function() { | ||||
|       graph.inspect().main.nodes.each(function(n) { n.fixed = true }); | ||||
|  | ||||
|       // FIXME | ||||
|       $.post( | ||||
|         '[% uri_for('/ajax/data/device/netmappositions') %]' | ||||
|         ,'positions=' + JSON.stringify(graph.positions()) | ||||
|       ); | ||||
|       if (mapdata['v3']['newnodes']) { | ||||
|         $.post( | ||||
|           '[% uri_for('/ajax/data/device/netmappositions') %]' | ||||
|           ,'positions=' + JSON.stringify(graph.positions()) | ||||
|         ); | ||||
|       } | ||||
|  | ||||
|       graph['nd2'] = {}; | ||||
|       graph['nd2']['dragging'] = false; | ||||
| @@ -89,7 +90,7 @@ $.getJSON('[% uri_for('/ajax/data/device/netmap') %]', {q: '[% params.q %]'}, fu | ||||
|       }), | ||||
|       'links': mapdata['v3']['links'] | ||||
|     }}; | ||||
|     graph.start(); | ||||
|     graph.start(netmapdata); | ||||
|  | ||||
|     // center on our selected device | ||||
| //    graph.inspect().main.force.on('end.centernode', function() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user