]>
BookStack Code Mirror - bookstack/blobdiff - resources/js/components/attachments-list.js
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5917 from BookStackApp/copy_references
[bookstack]
/
resources
/
js
/
components
/
attachments-list.js
diff --git
a/resources/js/components/attachments-list.js
b/resources/js/components/attachments-list.js
index 4db09977fec7ff0d20bf10192b4b59ca3caad1aa..665904f86163998503bd2cdd23c341f3c07d6aa4 100644
(file)
--- a/
resources/js/components/attachments-list.js
+++ b/
resources/js/components/attachments-list.js
@@
-9,6
+9,8
@@
export class AttachmentsList extends Component {
setup() {
this.container = this.$el;
setup() {
this.container = this.$el;
+ this.fileLinks = this.$manyRefs.linkTypeFile;
+
this.setupListeners();
}
this.setupListeners();
}
@@
-27,8
+29,7
@@
export class AttachmentsList extends Component {
}
addOpenQueryToLinks() {
}
addOpenQueryToLinks() {
- const links = this.container.querySelectorAll('a.attachment-file');
- for (const link of links) {
+ for (const link of this.fileLinks) {
if (link.href.split('?')[1] !== 'open=true') {
link.href += '?open=true';
link.setAttribute('target', '_blank');
if (link.href.split('?')[1] !== 'open=true') {
link.href += '?open=true';
link.setAttribute('target', '_blank');
@@
-37,8
+38,7
@@
export class AttachmentsList extends Component {
}
removeOpenQueryFromLinks() {
}
removeOpenQueryFromLinks() {
- const links = this.container.querySelectorAll('a.attachment-file');
- for (const link of links) {
+ for (const link of this.fileLinks) {
link.href = link.href.split('?')[0];
link.removeAttribute('target');
}
link.href = link.href.split('?')[0];
link.removeAttribute('target');
}