Merge pull request #1350 from lkiesow/settings-menu

Fix Hidden Settings Menu
This commit is contained in:
advplyr 2023-01-02 10:40:24 -06:00 committed by GitHub
commit b1d4e28027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="w-44 fixed left-0 top-16 h-full bg-bg bg-opacity-100 md:bg-opacity-70 shadow-lg border-r border-white border-opacity-5 py-3 transform transition-transform" :class="wrapperClass" v-click-outside="clickOutside"> <div class="w-44 fixed left-0 top-16 h-full bg-bg bg-opacity-100 md:bg-opacity-70 shadow-lg border-r border-white border-opacity-5 py-3 transform transition-transform" :class="wrapperClass" v-click-outside="clickOutside">
<div class="md:hidden flex items-center justify-end pb-2 px-4 mb-1" @click="closeDrawer"> <div v-show="isMobilePortrait" class="flex items-center justify-end pb-2 px-4 mb-1" @click="closeDrawer">
<span class="material-icons text-2xl">arrow_back</span> <span class="material-icons text-2xl">arrow_back</span>
</div> </div>
@ -114,7 +114,7 @@ export default {
var classes = [] var classes = []
if (this.drawerOpen) classes.push('translate-x-0') if (this.drawerOpen) classes.push('translate-x-0')
else classes.push('-translate-x-44') else classes.push('-translate-x-44')
if (this.isMobile) classes.push('z-50') if (this.isMobilePortrait) classes.push('z-50')
else classes.push('z-40') else classes.push('z-40')
return classes.join(' ') return classes.join(' ')
}, },
@ -124,9 +124,11 @@ export default {
isMobileLandscape() { isMobileLandscape() {
return this.$store.state.globals.isMobileLandscape return this.$store.state.globals.isMobileLandscape
}, },
isMobilePortrait() {
return this.$store.state.globals.isMobilePortrait
},
drawerOpen() { drawerOpen() {
if (this.isMobile) return this.isOpen return !this.isMobilePortrait || this.isOpen
return true
}, },
routeName() { routeName() {
return this.$route.name return this.$route.name

View File

@ -2,9 +2,9 @@
<div id="page-wrapper" class="page p-2 md:p-6 overflow-y-auto relative" :class="streamLibraryItem ? 'streaming' : ''"> <div id="page-wrapper" class="page p-2 md:p-6 overflow-y-auto relative" :class="streamLibraryItem ? 'streaming' : ''">
<app-config-side-nav :is-open.sync="sideDrawerOpen" /> <app-config-side-nav :is-open.sync="sideDrawerOpen" />
<div class="configContent" :class="`page-${currentPage}`"> <div class="configContent" :class="`page-${currentPage}`">
<div v-show="isMobile" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2"> <div v-show="isMobilePortrait" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2 cursor-pointer" @click.stop.prevent="toggleShowMore">
<span class="material-icons text-2xl cursor-pointer" @click.stop.prevent="showMore">more_vert</span> <span class="material-icons text-2xl cursor-pointer">arrow_forward</span>
<p class="pl-3 capitalize">{{ currentPage }}</p> <p class="pl-3 capitalize">{{ $strings.HeaderSettings }}</p>
</div> </div>
<nuxt-child /> <nuxt-child />
</div> </div>
@ -35,8 +35,8 @@ export default {
} }
}, },
computed: { computed: {
isMobile() { isMobilePortrait() {
return this.$store.state.globals.isMobile return this.$store.state.globals.isMobilePortrait
}, },
streamLibraryItem() { streamLibraryItem() {
return this.$store.state.streamLibraryItem return this.$store.state.streamLibraryItem
@ -60,8 +60,8 @@ export default {
} }
}, },
methods: { methods: {
showMore() { toggleShowMore() {
this.sideDrawerOpen = true this.sideDrawerOpen = !this.sideDrawerOpen
}, },
setDeveloperMode() { setDeveloperMode() {
var value = !this.$store.state.developerMode var value = !this.$store.state.developerMode

View File

@ -1,6 +1,7 @@
export const state = () => ({ export const state = () => ({
isMobile: false, isMobile: false,
isMobileLandscape: false, isMobileLandscape: false,
isMobilePortrait: false,
showBatchCollectionModal: false, showBatchCollectionModal: false,
showCollectionsModal: false, showCollectionsModal: false,
showEditCollectionModal: false, showEditCollectionModal: false,
@ -76,7 +77,8 @@ export const getters = {
export const mutations = { export const mutations = {
updateWindowSize(state, { width, height }) { updateWindowSize(state, { width, height }) {
state.isMobile = width < 640 || height < 640 state.isMobile = width < 640 || height < 640
state.isMobileLandscape = state.isMobile && height > width state.isMobileLandscape = state.isMobile && height < width
state.isMobilePortrait = state.isMobile && height >= width
}, },
setShowCollectionsModal(state, val) { setShowCollectionsModal(state, val) {
state.showBatchCollectionModal = false state.showBatchCollectionModal = false