metamaps--metamaps/app/views/topics/removefrommap.js.erb
2014-02-20 17:22:13 -08:00

27 lines
730 B
Text

/*
* @file
* This code removes a mapping from a topic on to a map, which removes the
* topic from that map.
* TODO: is this code still used?
* TODO: What URL accesses this code?
*/
if (Mconsole != null) {
var node = Mconsole.graph.getNode(<%= @mapping.topic_id %>);
if (node.id == Mconsole.root) {
Mconsole.graph.eachNode(function (n) {
if (n.id != node.id) Mconsole.root = n.id;
});
}
node.setData('alpha', 0, 'end');
node.eachAdjacency(function(adj) {
adj.setData('alpha', 0, 'end');
});
Mconsole.fx.animate({
modes: ['node-property:alpha',
'edge-property:alpha'],
duration: 1000
});
Mconsole.graph.removeNode(<%= @mapping.topic_id %>);
}