diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index b674186db..c16ea8008 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -3,7 +3,7 @@ <XSidebar ref="nav" class="sidebar"/> <div class="contents" ref="contents" :class="{ wallpaper }"> - <header class="header" ref="header"> + <header class="header" ref="header" @contextmenu.prevent.stop="onContextmenu"> <XHeader :info="pageInfo"/> </header> <main ref="main"> @@ -55,7 +55,7 @@ <script lang="ts"> import { defineComponent, defineAsyncComponent, markRaw } from 'vue'; -import { faLayerGroup, faBars, faHome, faCircle } from '@fortawesome/free-solid-svg-icons'; +import { faLayerGroup, faBars, faHome, faCircle, faWindowMaximize, faColumns } from '@fortawesome/free-solid-svg-icons'; import { faBell } from '@fortawesome/free-regular-svg-icons'; import { host } from '@/config'; import { search } from '@/scripts/search'; @@ -215,6 +215,26 @@ export default defineComponent({ if (window._scroll) window._scroll(); }, + onContextmenu(e) { + const url = this.$route.path; + os.contextMenu([{ + type: 'label', + text: url, + }, { + icon: faColumns, + text: this.$t('openInSideView'), + action: () => { + this.$refs.side.navigate(url); + } + }, { + icon: faWindowMaximize, + text: this.$t('openInWindow'), + action: () => { + os.pageWindow(url); + } + }], e); + }, + async onNotification(notification) { if (this.$store.state.i.mutingNotificationTypes.includes(notification.type)) { return;