2012-10-21 17:19:59 +00:00
|
|
|
$('#new_item').fadeOut('fast');
|
2012-10-21 17:46:27 +00:00
|
|
|
$('#new_item')[0].reset()
|
2012-10-21 18:32:17 +00:00
|
|
|
|
|
|
|
// if there's a map, add the node to that, if its in card view add card
|
|
|
|
obj = document.getElementById('container');
|
|
|
|
|
|
|
|
|
|
|
|
if (obj != null) {
|
|
|
|
var newnode = <%= @item.self_as_json.html_safe %>;
|
|
|
|
fd.graph.addNode(newnode);
|
|
|
|
var temp = fd.graph.getNode('<%= @item.id %>');
|
|
|
|
temp.setData('dim', 1, 'start');
|
|
|
|
temp.setData('dim', 40, 'end');
|
|
|
|
fd.fx.animate({
|
2012-10-21 17:46:27 +00:00
|
|
|
modes: ['node-property:dim'],
|
|
|
|
duration: 400
|
2012-10-21 18:32:17 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#cards').prepend('<%= escape_javascript(render(@item)) %>');
|
|
|
|
}
|
|
|
|
|