]> _ Git - pmi.git/commitdiff
fix #3044 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Oct 2019 17:01:30 +0000 (19:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Oct 2019 17:01:30 +0000 (19:01 +0200)
resources/js/app.js

index 457cce3bf529b11f2e94fe9267d0ddee87674174..4158d8481c1df853d5356b7a7b4c5ebcf1ee7edf 100644 (file)
@@ -17,6 +17,7 @@ require('element-closest');
 // the two possible header heights. It requires some variable duplication
 // but it's a reasonable compromise given the constraints...
 import cssVars from 'css-vars-ponyfill';
+
 cssVars({});
 
 
@@ -141,6 +142,17 @@ function getBodyScrollTop() {
     return el.scrollTop;
 }
 
+document.addEventListener('DOMContentLoaded', function () {
+    var links = document.links;
+
+    for (var i = 0, linksLength = links.length; i < linksLength; i++) {
+        var link = links[i];
+        if (!link.target && link.hostname !== window.location.hostname) {
+            link.target = '_blank';
+        }
+    }
+});
+
 document.addEventListener('scroll', function () {
     checkScroll();
 }, {passive: true});