X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9135a85de4eef32a91c7a3ee0aa405ed454e5a4c..3f5dc10cd4cf901b44b1cf8c9e2626bf0425d488:/resources/js/components/attachments-list.js diff --git a/resources/js/components/attachments-list.js b/resources/js/components/attachments-list.js index dfefd9b7f..4db09977f 100644 --- a/resources/js/components/attachments-list.js +++ b/resources/js/components/attachments-list.js @@ -1,4 +1,4 @@ -import {Component} from "./component"; +import {Component} from './component'; /** * Attachments List @@ -13,11 +13,11 @@ export class AttachmentsList extends Component { } setupListeners() { - const isExpectedKey = (event) => event.key === 'Control' || event.key === 'Meta'; + const isExpectedKey = event => event.key === 'Control' || event.key === 'Meta'; window.addEventListener('keydown', event => { - if (isExpectedKey(event)) { + if (isExpectedKey(event)) { this.addOpenQueryToLinks(); - } + } }, {passive: true}); window.addEventListener('keyup', event => { if (isExpectedKey(event)) { @@ -30,7 +30,7 @@ export class AttachmentsList extends Component { const links = this.container.querySelectorAll('a.attachment-file'); for (const link of links) { if (link.href.split('?')[1] !== 'open=true') { - link.href = link.href + '?open=true'; + link.href += '?open=true'; link.setAttribute('target', '_blank'); } } @@ -43,4 +43,5 @@ export class AttachmentsList extends Component { link.removeAttribute('target'); } } -} \ No newline at end of file + +}