hide logo when opening search bar on small screens

This commit is contained in:
Henry Jameson 2018-12-03 07:49:14 +03:00
parent e15b9bddbb
commit ea805bbbe6
4 changed files with 16 additions and 2 deletions

View file

@ -21,6 +21,7 @@ export default {
},
data: () => ({
mobileActivePanel: 'timeline',
finderHidden: true,
supportsMask: window.CSS && window.CSS.supports && (
window.CSS.supports('mask-size', 'contain') ||
window.CSS.supports('-webkit-mask-size', 'contain') ||
@ -53,7 +54,8 @@ export default {
},
logoBgStyle () {
return Object.assign({
'margin': `${this.$store.state.instance.logoMargin} 0`
'margin': `${this.$store.state.instance.logoMargin} 0`,
opacity: this.finderHidden ? 1 : 0
}, this.enableMask ? {} : {
'background-color': this.enableMask ? '' : 'transparent'
})
@ -75,6 +77,9 @@ export default {
logout () {
this.$router.replace('/main/public')
this.$store.dispatch('logout')
},
onFinderToggled (hidden) {
this.finderHidden = hidden
}
}
}

View file

@ -248,6 +248,9 @@ nav {
justify-content: center;
flex: 0 0 auto;
z-index: -1;
transition: opacity;
transition-timing-function: ease-out;
transition-duration: 100ms;
.mask {
mask-repeat: no-repeat;
@ -486,6 +489,11 @@ nav {
color: $fallback--faint;
color: var(--faint, $fallback--faint);
}
@media all and (min-width: 959px) {
.logo {
opacity: 1 !important;
}
}
@media all and (max-width: 959px) {
.mobile-hidden {

View file

@ -10,7 +10,7 @@
<router-link :to="{ name: 'root'}">{{sitename}}</router-link>
</div>
<div class='item right'>
<user-finder class="nav-icon"></user-finder>
<user-finder class="nav-icon" @toggled="onFinderToggled"></user-finder>
<router-link @click.native="activatePanel('timeline')" :to="{ name: 'settings'}"><i class="icon-cog nav-icon"></i></router-link>
<a href="#" v-if="currentUser" @click.prevent="logout"><i class="icon-logout nav-icon" :title="$t('login.logout')"></i></a>
</div>

View file

@ -11,6 +11,7 @@ const UserFinder = {
},
toggleHidden () {
this.hidden = !this.hidden
this.$emit('toggled', this.hidden)
}
}
}