Skip to content

Commit

Permalink
improve redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuan committed Mar 11, 2019
1 parent cb0aa75 commit 2e50738
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions page-map.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ into the {body} of the default.hbs template --}}
});
</script>

{{!-- <script>
<script>
all_nodes = document.getElementsByClassName("mindmap-svg")[0].getElementsByTagName("g")[2].getElementsByTagName("foreignObject");
function selectNode(node) {
this.addEventListener('click', function (e) {
e.preventDefault();
});
symbol = '➡️';
for (i = 0; i < all_nodes.length; i++) {
if (all_nodes[i].getElementsByTagName('a')[0].innerText.includes(symbol)) {
Expand All @@ -112,8 +115,14 @@ into the {body} of the default.hbs template --}}
}
}
node.innerText = symbol + node.innerText;
window.open(node.href, "_self");
if (node.href.includes("tag")) {
console.log('tag');
window.open(node.href, "_blank");
} else {
console.log('no tag');
window.open(node.href, "_self");
}
}
</script> --}}
</script>

{{/contentFor}}

0 comments on commit 2e50738

Please sign in to comment.