π 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
Add context menu to docs
Smaug67394fa545a4e0d8
diff --git a/frontend/app/components/ContextMenuManager.vue b/frontend/app/components/ContextMenuManager.vueindex a6b01119..94a2e685 100644--- a/frontend/app/components/ContextMenuManager.vue+++ b/frontend/app/components/ContextMenuManager.vue@@ -136,7 +136,7 @@ const pos = computed(() => {// Estimated menu dimensions (cannot measure before rendering)const menuWidth = 240;- const menuHeight = 380;+ const menuHeight = 340;const pad = 8;const vw = typeof window !== 'undefined' ? window.innerWidth : 1920;const vh = typeof window !== 'undefined' ? window.innerHeight : 1080;diff --git a/frontend/app/pages/dashboard/docs/[id].vue b/frontend/app/pages/dashboard/docs/[id].vueindex 89c52a85..6bc3759b 100644--- a/frontend/app/pages/dashboard/docs/[id].vue+++ b/frontend/app/pages/dashboard/docs/[id].vue@@ -1,6 +1,6 @@<!-- eslint-disable vue/no-v-html --><template>- <div style="width: 100%; padding: 1rem 0">+ <div style="width: 100%; padding: 1rem 0" @contextmenu.prevent="showContextMenu"><div v-if="!error" style="display: flex; justify-content: space-between"><div :style="{ maxWidth: width }" class="doc-container"><DocumentCardHeader :doc="node" style="margin-bottom: 20px" />@@ -38,6 +38,7 @@ import DocumentCardHeader from './_components/DocumentCardHeader.vue';import DocumentCardFooter from './_components/DocumentCardFooter.vue';import DocumentSkeleton from './_components/DocumentSkeleton.vue';import type { Node } from '~/stores';+import NodeContextMenu from '~/components/Node/NodeContextMenu.vue';const route = useRoute();const documentsStore = useNodesStore();@@ -81,6 +82,15 @@ const width = computed(() => {return '700px';});+// Context menu+const contextMenu = useContextMenu();++function showContextMenu(event: MouseEvent) {+ contextMenu.open(shallowRef(NodeContextMenu), event, {+ props: { node: node.value, contextMenu: true },+ });+}+onMounted(() => {// Keyboard shortcuts management for navigating between corresponding pagesconst handleDocumentKeydown = (e: KeyboardEvent) => {