From 749102f9c2d229a1ccf8d9d96e1e206bb2b26f09 Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Sun, 25 Oct 2020 09:26:19 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E3=82=82=E3=82=B3=E3=83=B3=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/ui/default.vue | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) 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;