added ability to add node on rgraph pages
This commit is contained in:
parent
1bc69512de
commit
851b133ed1
1 changed files with 13 additions and 0 deletions
|
@ -7,6 +7,8 @@ obj = document.getElementById('container');
|
|||
|
||||
if (obj != null) {
|
||||
var newnode = <%= @item.self_as_json.html_safe %>;
|
||||
|
||||
if (fd != null) {
|
||||
fd.graph.addNode(newnode);
|
||||
var temp = fd.graph.getNode('<%= @item.id %>');
|
||||
temp.setData('dim', 1, 'start');
|
||||
|
@ -16,6 +18,17 @@ if (obj != null) {
|
|||
duration: 400
|
||||
});
|
||||
}
|
||||
else if (rg != null) {
|
||||
rg.graph.addNode(newnode);
|
||||
var temp = rggraph.getNode('<%= @item.id %>');
|
||||
temp.setData('dim', 1, 'start');
|
||||
temp.setData('dim', 40, 'end');
|
||||
rg.fx.animate({
|
||||
modes: ['node-property:dim'],
|
||||
duration: 400
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#cards').prepend('<%= escape_javascript(render(@item)) %>');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue