File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ export class AttachmentsList extends Component {
99
1010 setup ( ) {
1111 this . container = this . $el ;
12+ this . fileLinks = this . $manyRefs . linkTypeFile ;
13+
1214 this . setupListeners ( ) ;
1315 }
1416
@@ -27,8 +29,7 @@ export class AttachmentsList extends Component {
2729 }
2830
2931 addOpenQueryToLinks ( ) {
30- const links = this . container . querySelectorAll ( 'a.attachment-file' ) ;
31- for ( const link of links ) {
32+ for ( const link of this . fileLinks ) {
3233 if ( link . href . split ( '?' ) [ 1 ] !== 'open=true' ) {
3334 link . href += '?open=true' ;
3435 link . setAttribute ( 'target' , '_blank' ) ;
@@ -37,8 +38,7 @@ export class AttachmentsList extends Component {
3738 }
3839
3940 removeOpenQueryFromLinks ( ) {
40- const links = this . container . querySelectorAll ( 'a.attachment-file' ) ;
41- for ( const link of links ) {
41+ for ( const link of this . fileLinks ) {
4242 link . href = link . href . split ( '?' ) [ 0 ] ;
4343 link . removeAttribute ( 'target' ) ;
4444 }
Original file line number Diff line number Diff line change 22 @foreach ($attachments as $attachment )
33 <div class =" attachment icon-list" >
44 <div class =" split-icon-list-item attachment-{{ $attachment -> external ? ' link' : ' file' } }" >
5- <a href =" {{ $attachment -> getUrl () } }" @if ($attachment -> external ) target =" _blank" @endif >
5+ <a href =" {{ $attachment -> getUrl () } }"
6+ refs =" attachments-list@link-type-{{ $attachment -> external ? ' link' : ' file' } }"
7+ @if ($attachment -> external ) target =" _blank" @endif >
68 <div class =" icon" >@icon ($attachment -> external ? ' export' : ' file' )</div >
79 <div class =" label" >{{ $attachment -> name } } </div >
810 </a >
You can’t perform that action at this time.
0 commit comments