summaryrefslogtreecommitdiff
path: root/src/client/ui
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-10-25 09:26:19 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-10-25 09:26:19 +0900
commit749102f9c2d229a1ccf8d9d96e1e206bb2b26f09 (patch)
tree6765bc935e844a02efd635f2c8d9a3baad4aba3f /src/client/ui
parentRefactor (diff)
downloadsharkey-749102f9c2d229a1ccf8d9d96e1e206bb2b26f09.tar.gz
sharkey-749102f9c2d229a1ccf8d9d96e1e206bb2b26f09.tar.bz2
sharkey-749102f9c2d229a1ccf8d9d96e1e206bb2b26f09.zip
ヘッダーにもコンテキストメニュー追加
Diffstat (limited to 'src/client/ui')
-rw-r--r--src/client/ui/default.vue24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue
index b674186dbe..c16ea8008b 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;