diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-12-05 20:49:58 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-12-05 20:49:58 +0100 |
| commit | 026ab7c1dffa858d9dbdfada44b50097db1e0bd2 (patch) | |
| tree | 418d7cd37587fd41fb808bbcb28657043508ce84 /src/components/attachment/attachment.vue | |
| parent | 917917596fe7c9185590bf3c6cc267a0d6a89e5a (diff) | |
| parent | be5fe03972879add14ce2ca6b37524b32adbf1b8 (diff) | |
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma-fe into develop
Diffstat (limited to 'src/components/attachment/attachment.vue')
| -rw-r--r-- | src/components/attachment/attachment.vue | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 1e49cbeb..6bc0356a 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -1,15 +1,18 @@ <template> <div class="attachment"> - <a class="image-attachment" v-if="nsfw" v-on:click.prevent="showNsfw()"> + <a class="image-attachment" v-if="hidden" v-on:click.prevent="toggleHidden()"> <img :key="nsfwImage" :src="nsfwImage"></img> </a> + <div class="hider" v-if="nsfw && !hidden"> + <a href="#" @click.prevent="toggleHidden()">Hide</a> + </div> - <a class="image-attachment" v-if="type === 'image' && !nsfw" + <a class="image-attachment" v-if="type === 'image' && !hidden" :href="attachment.url" target="_blank"> <img :src="attachment.url"></img> </a> - <video v-if="type === 'video' && !nsfw" :src="attachment.url" controls></video> + <video v-if="type === 'video' && !hidden" :src="attachment.url" controls></video> <audio v-if="type === 'audio'" :src="attachment.url" controls></audio> @@ -34,12 +37,20 @@ display: flex; flex-wrap: wrap; .attachment { - flex: 1 0 30%; display: flex; margin: 0.2em; align-self: flex-start; + .hider { + position: absolute; + margin: 10px; + padding: 5px; + background: rgba(230,230,230,0.6); + border-radius: 0.5em; + font-weight: bold; + } + video { height: 100%; border: 1px solid; |
