]> BookStack Code Mirror - hacks/commitdiff
Merge branch 'main' of github.com:BookStackApp/hacks
authorDan Brown <redacted>
Wed, 7 Jun 2023 09:58:33 +0000 (10:58 +0100)
committerDan Brown <redacted>
Wed, 7 Jun 2023 09:58:33 +0000 (10:58 +0100)
content/force-page-links-new-tab/head.html

index 4f251e2310657ef717c6ce693b0adaea6f484b23..7d8cc30d3d32a757fc864d4b24fa54d3513f52bc 100644 (file)
@@ -1,8 +1,6 @@
-<script>
-document.addEventListener('DOMContentLoaded', function() {
+<script type="module">
     const links = document.querySelectorAll('.page-content a');
     for (const link of links) {
-        links[i].target = '_blank';
+        link.target = '_blank';
     }
-});
 </script>
\ No newline at end of file