2323 <div
2424 v-if =" isMediaAttachment"
2525 contenteditable =" false"
26- class =" media"
27- @click =" handleAttachmentClick" >
28- <div class =" media__wrapper" >
26+ class =" media" >
27+ <a
28+ class =" media-wrapper media-wrapper__attachment"
29+ @click =" handleAttachmentClick" >
2930 <img
3031 v-show =" loaded"
3132 :src =" imageUrl"
3637 <span class =" name" >{{ alt }}</span >
3738 <span class =" size" >{{ attachmentSize }}</span >
3839 </div >
39- </div >
40+ </a >
4041 <div v-if =" showDeleteIcon" class =" buttons" >
4142 <NcButton
4243 :aria-label =" t (' text' , ' Delete this attachment' )"
4849 </NcButton >
4950 </div >
5051 </div >
51- <div v-else class =" media" contenteditable =" false" >
52- <img
53- v-show =" loaded"
54- :src =" imageUrl"
55- :alt =" alt"
56- class =" image__main"
57- @click =" handleImageClick"
58- @load =" onLoaded" />
52+ <div
53+ v-else
54+ contenteditable =" false"
55+ class =" media media__image" >
56+ <a class =" media-wrapper" @click =" handleImageClick" >
57+ <img
58+ v-show =" loaded"
59+ :src =" imageUrl"
60+ :alt =" alt"
61+ class =" image__main"
62+ @load =" onLoaded" />
63+ </a >
5964 </div >
6065 </template >
6166 <template v-else >
@@ -552,15 +557,25 @@ export default {
552557 justify- content: left;
553558 padding- bottom: 0 ;
554559
555- .media__wrapper {
556- display: flex;
557- border: 2px solid var (-- color- border);
558- border- radius: var (-- border- radius- large);
559- padding: 8px ;
560+ & __image {
561+ justify- content: center;
562+ }
560563
561- img {
562- width: var (-- default- clickable- area);
563- height: var (-- default- clickable- area);
564+ .media - wrapper {
565+ display: flex;
566+ // Overwrite some global rules for a elments
567+ text- decoration: none;
568+ color: var (-- color- main- text);
569+
570+ & __attachment {
571+ border: 2px solid var (-- color- border);
572+ border- radius: var (-- border- radius- large);
573+ padding: 8px ;
574+
575+ img {
576+ width: var (-- default- clickable- area);
577+ height: var (-- default- clickable- area);
578+ }
564579 }
565580
566581 .metadata {
@@ -579,6 +594,7 @@ export default {
579594 }
580595 }
581596 }
597+
582598 .buttons {
583599 margin- left: 8px ;
584600 }
0 commit comments