fix and changes revies, fix lint

This commit is contained in:
ogerly 2019-12-06 09:16:14 +01:00
parent dee22d33db
commit a62d59741b
4 changed files with 26 additions and 47 deletions

View File

@ -249,7 +249,6 @@ describe('ContributionForm.vue', () => {
wrapper.find(TeaserImage).vm.$emit('addTeaserImage', imageUpload) wrapper.find(TeaserImage).vm.$emit('addTeaserImage', imageUpload)
expect(wrapper.find('.images-set-blur').exists()).toBe(false) expect(wrapper.find('.images-set-blur').exists()).toBe(false)
await wrapper.find('input[type="checkbox"]').trigger('click') await wrapper.find('input[type="checkbox"]').trigger('click')
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true)
expect(wrapper.find('.images-set-blur').exists()).toBe(true) expect(wrapper.find('.images-set-blur').exists()).toBe(true)
}) })
}) })

View File

@ -10,7 +10,7 @@
<hc-teaser-image <hc-teaser-image
:contribution="contribution" :contribution="contribution"
@addTeaserImage="addTeaserImage" @addTeaserImage="addTeaserImage"
:class="{ 'images-set-blur': checkedBlur }" :class="{ 'images-set-blur': blurImage }"
@addImageAspectRatio="addImageAspectRatio" @addImageAspectRatio="addImageAspectRatio"
> >
<img <img
@ -20,20 +20,13 @@
/> />
</hc-teaser-image> </hc-teaser-image>
<ds-text align="right" class="blurBox"> <ds-text align="right" class="blurBox">
<div v-show="checkedBlur"> <div v-show="blurImage">
<ds-button
v-if="contribution"
class="bluricon-post"
icon="ban"
primary
@click.prevent="unBlur"
></ds-button>
<img <img
v-if="contribution"
:src="contribution.image | proxyApiUrl" :src="contribution.image | proxyApiUrl"
class="blurImgPreview" class="blurImgPreview"
@click.prevent="unBlur" @click.prevent="unBlur"
/> />
<ds-button class="bluricon-post" icon="ban" primary @click.prevent="unBlur"></ds-button>
</div> </div>
</ds-text> </ds-text>
<div style="clear: both" /> <div style="clear: both" />
@ -45,8 +38,8 @@
class="blurImageCheckbox" class="blurImageCheckbox"
type="checkbox" type="checkbox"
id="blur_img" id="blur_img"
v-model="checkedBlur" v-model="blurImage"
@change="form.checkbox = checkedBlur" @change="form.checkbox = blurImage"
/> />
<label for="blur_img"><span class=""></span></label> <label for="blur_img"><span class=""></span></label>
@ -223,13 +216,13 @@ export default {
contentMin: 3, contentMin: 3,
hashtags: [], hashtags: [],
elem: null, elem: null,
checkedBlur: false, blurImage: false,
} }
}, },
created() {}, created() {},
mounted() { mounted() {
if (this.contribution && this.contribution.blurImage === true) { if (this.contribution && this.contribution.blurImage === true) {
this.checkedBlur = true this.blurImage = true
} }
}, },
computed: { computed: {
@ -242,8 +235,8 @@ export default {
}, },
methods: { methods: {
unBlur() { unBlur() {
if (this.checkedBlur) { if (this.blurImage) {
this.checkedBlur = false this.blurImage = false
} }
}, },
submit() { submit() {
@ -335,18 +328,6 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.img-blur-in {
-webkit-filter: blur(32px);
-moz-filter: blur(32px);
-ms-filter: blur(32px);
-o-filter: blur(32px);
filter: blur(32px);
-webkit-transition: all ease 0.2s;
-moz-transition: all ease 0.2s;
-ms-transition: all ease 0.2s;
-o-transition: all ease 0.2s;
transition: all ease 0.2s;
}
.images-set-blur img { .images-set-blur img {
-webkit-filter: blur(32px); -webkit-filter: blur(32px);
-moz-filter: blur(32px); -moz-filter: blur(32px);

View File

@ -149,7 +149,7 @@ export default {
mounted() { mounted() {
const width = this.$el.offsetWidth const width = this.$el.offsetWidth
const height = Math.min(width / this.post.imageAspectRatio, 2000) const height = Math.min(width / this.post.imageAspectRatio, 2000)
const imageElement = this.$el.querySelector('.ds-card-image') const imageElement = this.$el.querySelector('.ds-card-imag')
if (imageElement) { if (imageElement) {
imageElement.style.height = `${height}px` imageElement.style.height = `${height}px`
@ -174,7 +174,6 @@ export default {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.ds-card-image { .ds-card-image {
width: 100%; width: 100%;
max-height: 2000px; max-height: 2000px;

View File

@ -10,27 +10,27 @@
'images-set-blur': post.blurImage, 'images-set-blur': post.blurImage,
}" }"
> >
<ds-text align="right" class="blurBox"> <ds-text v-show="post.blurImage" align="right" class="blurBox">
<ds-button <img
v-if="post.blurImage" v-show="!blurred"
class="bluricon-post" :src="post.image | proxyApiUrl"
icon="eye" class="blurImgPreview"
primary
@click.prevent="unBlur" @click.prevent="unBlur"
></ds-button> />
<ds-button <ds-button
v-if="blur" v-if="blurred"
class="bluricon-post" class="bluricon-post"
icon="eye-slash" icon="eye-slash"
primary primary
@click.prevent="setBlur" @click.prevent="setBlur"
></ds-button> ></ds-button>
<img <ds-button
v-if="post.blurImage" v-else
:src="post.image | proxyApiUrl" class="bluricon-post"
class="blurImgPreview" icon="eye"
primary
@click.prevent="unBlur" @click.prevent="unBlur"
/> ></ds-button>
</ds-text> </ds-text>
<div style="clear: both" /> <div style="clear: both" />
<hc-user :user="post.author" :date-time="post.createdAt"> <hc-user :user="post.author" :date-time="post.createdAt">
@ -151,7 +151,7 @@ export default {
ready: false, ready: false,
title: 'loading', title: 'loading',
showNewCommentForm: true, showNewCommentForm: true,
blur: false, blurred: false,
} }
}, },
watch: { watch: {
@ -180,13 +180,13 @@ export default {
unBlur() { unBlur() {
if (this.post.blurImage) { if (this.post.blurImage) {
this.post.blurImage = false this.post.blurImage = false
this.blur = true this.blurred = true
} }
}, },
setBlur() { setBlur() {
if (!this.post.blurImage) { if (!this.post.blurImage) {
this.post.blurImage = true this.post.blurImage = true
this.blur = false this.blurred = false
} }
}, },
isAuthor(id) { isAuthor(id) {