diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-03-25 19:53:38 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-03-25 19:54:22 +0100 |
commit | d17713051ca2fef29de8025fe876d417838cea7f (patch) | |
tree | 77f51378b10ba2e4c938fbbc8bc68cd030079c62 /src/map.js | |
parent | 70266304bab399b827af4acab153daaa47a2ba93 (diff) | |
download | wcms-d17713051ca2fef29de8025fe876d417838cea7f.tar.gz wcms-d17713051ca2fef29de8025fe876d417838cea7f.zip |
graph look, add redirections, close #50
Diffstat (limited to 'src/map.js')
-rw-r--r-- | src/map.js | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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'); + } +}); |