Skip to content

Commit

Permalink
fix bug with opening sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlackbird14 committed May 28, 2024
1 parent faf6eee commit 9790468
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/components/homeworkHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ const props = defineProps({
}
})
const sidebarVisible = ref(false)
const mobileWidth = ref(window.screen.width <= 700)
function reload() {
sidebarVisible.value = false
emit('reload')
}
</script>
Expand Down Expand Up @@ -58,10 +60,11 @@ function reload() {
tabindex="-1"
id="sidebar"
aria-labelledby="sidebar"
:class="{ show: sidebarVisible }"
data-bs-backdrop="true"
data-bs-scroll="true"
>
<Sidebar @reload="reload"></Sidebar>
<Sidebar @toggle="sidebarVisible = !sidebarVisible" @reload="reload"></Sidebar>
</div>
</template>

Expand Down Expand Up @@ -101,5 +104,4 @@ a {
visibility: hidden;
}
}
</style>
9 changes: 6 additions & 3 deletions src/components/homeworkListItem.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {type PropType, ref} from 'vue'
import { type PropType, ref } from 'vue'
import type { homework } from '@/scripts/types/homework.interface'
import { computed } from 'vue'
import apiService from '@/scripts/api.service'
Expand Down Expand Up @@ -86,9 +86,12 @@ function deleteHomework() {
<template>
<div
class="d-flex justify-content-between align-items-center mb-3 align-middle list-item"
:class="[ divClass, {'flex-column': mobileWidth}]"
:class="[divClass, { 'flex-column': mobileWidth }]"
>
<div v-if="mobileWidth" class="d-flex flex-row justify-content-between align-items-center align-middle">
<div
v-if="mobileWidth"
class="d-flex flex-row justify-content-between align-items-center align-middle"
>
<div class="p-2 col-sm-2">
<h1>{{ homeworkEntry.subject }}</h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebarComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function logout() {
@click="emit('reload')"
data-bs-toggle="offcanvas"
data-bs-target="#sidebar"
style="font-size: 250%; cursor: pointer; color"
style="font-size: 250%; cursor: pointer"
></i>
</div>

Expand Down

0 comments on commit 9790468

Please sign in to comment.