aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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');
+ }
+});