sensitiveではないメディアも非表示にできるように (#6248)

* sensitiveではないメディアも非表示にできるように

* mounted -> created

* remove unnecessary v-if
This commit is contained in:
Satsuki Yanagi 2020-04-13 23:55:36 +09:00 committed by GitHub
parent a19e252c9e
commit 58d3a37908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -1,12 +1,12 @@
<template>
<div class="qjewsnkgzzxlxtzncydssfbgjibiehcy" v-if="image.isSensitive && hide && !$store.state.device.alwaysShowNsfw" @click="hide = false">
<div class="qjewsnkgzzxlxtzncydssfbgjibiehcy" v-if="hide" @click="hide = false">
<div>
<b><fa :icon="faExclamationTriangle"/> {{ $t('sensitive') }}</b>
<span>{{ $t('clickToShow') }}</span>
</div>
</div>
<div class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else>
<i><fa :icon="faEyeSlash" @click="hide = true"></fa></i>
<i><fa :icon="faEyeSlash" @click="hide = true"/></i>
<a
:href="image.url"
:style="style"
@ -63,6 +63,9 @@ export default Vue.extend({
};
}
},
created() {
this.hide = this.image.isSensitive && !this.$store.state.device.alwaysShowNsfw;
},
methods: {
onClick() {
if (this.$store.state.device.imageNewTab) {

View File

@ -1,12 +1,12 @@
<template>
<div class="icozogqfvdetwohsdglrbswgrejoxbdj" v-if="video.isSensitive && hide && !$store.state.device.alwaysShowNsfw" @click="hide = false">
<div class="icozogqfvdetwohsdglrbswgrejoxbdj" v-if="hide" @click="hide = false">
<div>
<b><fa icon="exclamation-triangle"/> {{ $t('sensitive') }}</b>
<b><fa :icon="faExclamationTriangle"/> {{ $t('sensitive') }}</b>
<span>{{ $t('clickToShow') }}</span>
</div>
</div>
<div class="kkjnbbplepmiyuadieoenjgutgcmtsvu" v-else>
<i><fa :icon="faEyeSlash" @click="hide = true"></fa></i>
<i><fa :icon="faEyeSlash" @click="hide = true"/></i>
<a
:href="video.url"
rel="nofollow noopener"
@ -21,7 +21,8 @@
<script lang="ts">
import Vue from 'vue';
import { faPlayCircle, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
import { faPlayCircle } from '@fortawesome/free-regular-svg-icons';
import { faExclamationTriangle, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
import i18n from '../i18n';
export default Vue.extend({
@ -36,6 +37,7 @@ export default Vue.extend({
return {
hide: true,
faPlayCircle,
faExclamationTriangle,
faEyeSlash
};
},
@ -45,7 +47,10 @@ export default Vue.extend({
'background-image': `url(${this.video.thumbnailUrl})`
};
}
}
},
created() {
this.hide = this.video.isSensitive && !this.$store.state.device.alwaysShowNsfw;
},
});
</script>