From e69a5fa3fe18bf03a61f57db689f2388c7d8886f Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 17 Jun 2020 20:49:03 +0200 Subject: [PATCH] Double clicking a node will go to that page --- templates/graph.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/graph.html b/templates/graph.html index cbd363c..0fbaadc 100644 --- a/templates/graph.html +++ b/templates/graph.html @@ -40,7 +40,12 @@ var network = new vis.Network(container, data, options); network.on('doubleClick', function (props) { console.log(props) - // window.location.href = '/edit/'+props.items[0] + if (props.nodes.length) { + let nodeId = props.nodes[0] + let node = nodes.get(nodeId) + console.log(node) + window.location.href = '/edit/'+node.label + } })