aboutsummaryrefslogtreecommitdiff
path: root/src/map.js
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-03-25 19:53:38 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-03-25 19:54:22 +0100
commitd17713051ca2fef29de8025fe876d417838cea7f (patch)
tree77f51378b10ba2e4c938fbbc8bc68cd030079c62 /src/map.js
parent70266304bab399b827af4acab153daaa47a2ba93 (diff)
downloadwcms-d17713051ca2fef29de8025fe876d417838cea7f.tar.gz
wcms-d17713051ca2fef29de8025fe876d417838cea7f.zip
graph look, add redirections, close #50
Diffstat (limited to 'src/map.js')
-rw-r--r--src/map.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map.js b/src/map.js
index 5da0e57..4723318 100644
--- a/src/map.js
+++ b/src/map.js
@@ -10,3 +10,23 @@ let options = {
Object.assign(options, data);
let cy = cytoscape(options);
+
+cy.on('tap', 'node', function() {
+ try {
+ // your browser may block popups
+ window.open(this.data('id'));
+ } catch (e) {
+ // fall back on url change
+ window.location.href = this.data('id');
+ }
+});
+
+cy.on('cxttap', 'node', function() {
+ try {
+ // your browser may block popups
+ window.open(this.data('edit'));
+ } catch (e) {
+ // fall back on url change
+ window.location.href = this.data('edit');
+ }
+});