Closes #181: Open cable on double-click (#225)

* Closes #181: Open cable on double-click

* build js

Co-authored-by: mattieserver <3049868+mattieserver@users.noreply.github.com>
This commit is contained in:
Mario
2022-12-27 14:57:32 +01:00
committed by GitHub
co-authored by mattieserver
parent dfb0b532b9
commit 0cb0c10dbb
3 changed files with 17 additions and 6 deletions
+10 -3
View File
@@ -100,9 +100,16 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
})
graph.on('doubleClick', (params) => {
params.nodes.forEach((node) => {
window.open(nodes.get(node).href, '_blank')
})
if (params.nodes.length > 0) {
params.nodes.forEach((node) => {
window.open(nodes.get(node).href, '_blank')
})
}
else {
params.edges.forEach((edge) => {
window.open(edges.get(edge).href, '_blank')
})
}
})
})()