From 851b133ed1e533b97401ff80560bb36b0160e471 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sun, 21 Oct 2012 16:08:41 -0400 Subject: [PATCH] added ability to add node on rgraph pages --- app/views/items/create.js.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/items/create.js.erb b/app/views/items/create.js.erb index f3e3ea50..289b5e1a 100644 --- a/app/views/items/create.js.erb +++ b/app/views/items/create.js.erb @@ -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'); @@ -15,6 +17,17 @@ if (obj != null) { modes: ['node-property:dim'], 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)) %>');