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) {
|
if (obj != null) {
|
||||||
var newnode = <%= @item.self_as_json.html_safe %>;
|
var newnode = <%= @item.self_as_json.html_safe %>;
|
||||||
|
|
||||||
|
if (fd != null) {
|
||||||
fd.graph.addNode(newnode);
|
fd.graph.addNode(newnode);
|
||||||
var temp = fd.graph.getNode('<%= @item.id %>');
|
var temp = fd.graph.getNode('<%= @item.id %>');
|
||||||
temp.setData('dim', 1, 'start');
|
temp.setData('dim', 1, 'start');
|
||||||
|
@ -15,6 +17,17 @@ if (obj != null) {
|
||||||
modes: ['node-property:dim'],
|
modes: ['node-property:dim'],
|
||||||
duration: 400
|
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 {
|
else {
|
||||||
$('#cards').prepend('<%= escape_javascript(render(@item)) %>');
|
$('#cards').prepend('<%= escape_javascript(render(@item)) %>');
|
||||||
|
|
Loading…
Reference in a new issue