π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Fix medium view
Smaug67392fc7e562ac8d
diff --git a/dashboard/components/MediumView.vue b/dashboard/components/MediumView.vueindex f5caee1f..4dfd0e04 100644--- a/dashboard/components/MediumView.vue+++ b/dashboard/components/MediumView.vue@@ -1,14 +1,15 @@<template>- <main class="medium-view" ref="mediumContainer" :style="{ marginLeft }">+ <main class="medium-view" ref="mediumContainer" :style="{ marginLeft, transition }"><slot></slot></main></template><script setup lang="ts">-const { isOpened, paneWidth } = useSidebar();+const { isOpened, paneWidth, isResizing } = useSidebar();const mediumContainer = ref<HTMLElement | null>(null);const isMobile = () => process.client ? window.innerWidth <= 768 : false;const marginLeft = computed(() => (isMobile() || !isOpened.value) ? '0' : `${paneWidth.value}px`);+const transition = computed(() => isResizing.value ? 'none' : 'margin-left 0.3s');</script><style scoped>diff --git a/dashboard/components/sidebar/Resizable.vue b/dashboard/components/sidebar/Resizable.vueindex 8c5d696c..4b50ff2c 100644--- a/dashboard/components/sidebar/Resizable.vue+++ b/dashboard/components/sidebar/Resizable.vue@@ -11,9 +11,8 @@</template><script setup lang="ts">-const { isOpened, paneWidth } = useSidebar();+const { isOpened, paneWidth, isResizing } = useSidebar();-const isResizing = ref(false)const startX = ref(0)const startWidth = ref(0)const panewidthCSS = computed(() => `${paneWidth.value}px`)diff --git a/dashboard/composables/Sidebar.ts b/dashboard/composables/Sidebar.tsindex 38215be0..1059d39d 100644--- a/dashboard/composables/Sidebar.ts+++ b/dashboard/composables/Sidebar.ts@@ -1,8 +1,9 @@import { ref } from 'vue';-export const isOpened = ref(false);-export const hasSidebar = ref(false);-export const paneWidth = ref(360); // initial width of pane 1+const isOpened = ref(false);+const hasSidebar = ref(false);+const paneWidth = ref(360); // initial width of pane 1+const isResizing = ref(false);export function useSidebar() {const toggleSidebar = () => {@@ -14,5 +15,6 @@ export function useSidebar() {isOpened,hasSidebar,paneWidth,+ isResizing,};}