Double clicking a node will go to that page
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2020-06-17 20:49:03 +02:00
parent 7f7cd71a17
commit e69a5fa3fe

View File

@ -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
}
})
</script>