diff options
Diffstat (limited to 'src')
-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'); + } +}); |