fix: top navigation not usable
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2022-04-02 14:38:52 +02:00
parent f8ca1c47a9
commit 7ff8daf6e2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 35 additions and 21 deletions

View File

@ -1,9 +1,9 @@
<template> <template>
<div> <div class="content-auth" :class="{'modal-active': modalActive}">
<BaseButton <BaseButton
v-if="menuActive" v-if="menuActive"
@click="$store.commit('menuActive', false)" @click="$store.commit('menuActive', false)"
class="menu-hide-button" class="menu-hide-button"
> >
<icon icon="times"/> <icon icon="times"/>
</BaseButton> </BaseButton>
@ -41,12 +41,12 @@
<transition name="modal"> <transition name="modal">
<modal <modal
v-if="currentModal" v-if="currentModal"
@close="closeModal()" @close="closeModal()"
variant="scrolling" variant="scrolling"
class="task-detail-view-modal" class="task-detail-view-modal"
> >
<component :is="currentModal" /> <component :is="currentModal"/>
</modal> </modal>
</transition> </transition>
@ -119,17 +119,17 @@ function useRouteWithModal() {
} }
} }
return { routeWithModal, currentModal, closeModal } return {routeWithModal, currentModal, closeModal}
} }
const { routeWithModal, currentModal, closeModal } = useRouteWithModal() const {routeWithModal, currentModal, closeModal} = useRouteWithModal()
const store = useStore() const store = useStore()
const background = computed(() => store.state.background) const background = computed(() => store.state.background)
const blurHash = computed(() => store.state.blurHash) const blurHash = computed(() => store.state.blurHash)
const menuActive = computed(() => store.state.menuActive) const menuActive = computed(() => store.state.menuActive)
const modalActive = computed(() => store.state.modalActive)
function showKeyboardShortcuts() { function showKeyboardShortcuts() {
store.commit(KEYBOARD_SHORTCUTS_ACTIVE, true) store.commit(KEYBOARD_SHORTCUTS_ACTIVE, true)
@ -238,15 +238,15 @@ store.dispatch('labels/loadAllLabels')
padding-top: $navbar-height; padding-top: $navbar-height;
} }
.app-content { .app-content {
padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem; padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem;
z-index: 10; z-index: 10;
position: relative; position: relative;
// Used to make sure the spinner is always in the middle while loading // Used to make sure the spinner is always in the middle while loading
> .loader-container { > .loader-container {
min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem}); min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem});
} }
@media screen and (max-width: $tablet) { @media screen and (max-width: $tablet) {
margin-left: 0; margin-left: 0;
@ -263,10 +263,10 @@ store.dispatch('labels/loadAllLabels')
} }
} }
.card { .card {
background: var(--white); background: var(--white);
} }
} }
} }
.mobile-overlay { .mobile-overlay {
@ -303,5 +303,14 @@ store.dispatch('labels/loadAllLabels')
} }
} }
.content-auth {
position: relative;
z-index: 1;
&.modal-active {
z-index: unset;
}
}
@include modal-transition(); @include modal-transition();
</style> </style>

View File

@ -64,6 +64,9 @@
import BaseButton from '@/components/base/BaseButton.vue' import BaseButton from '@/components/base/BaseButton.vue'
import {ref, watch} from 'vue' import {ref, watch} from 'vue'
import {useScrollLock} from '@vueuse/core' import {useScrollLock} from '@vueuse/core'
import {useStore} from 'vuex'
const store = useStore()
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
enabled?: boolean, enabled?: boolean,
@ -86,6 +89,7 @@ watch(
() => props.enabled, () => props.enabled,
enabled => { enabled => {
scrollLock.value = enabled scrollLock.value = enabled
store.commit('modalActive', enabled)
}, },
{ {
immediate: true, immediate: true,

View File

@ -51,6 +51,7 @@ export const store = createStore({
menuActive: true, menuActive: true,
keyboardShortcutsActive: false, keyboardShortcutsActive: false,
quickActionsActive: false, quickActionsActive: false,
modalActive: false,
}, },
mutations: { mutations: {
[LOADING](state, loading) { [LOADING](state, loading) {
@ -89,8 +90,8 @@ export const store = createStore({
[BLUR_HASH](state, blurHash) { [BLUR_HASH](state, blurHash) {
state.blurHash = blurHash state.blurHash = blurHash
}, },
vikunjaReady(state, ready) { modalActive(state, active) {
state.vikunjaReady = ready state.modalActive = active
}, },
}, },
actions: { actions: {