summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2021-02-07 00:11:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2021-02-07 00:11:16 +0900
commit871d2bad17e5060c3d970b3dab3cb5434abccee6 (patch)
treed945d91cca4e7d60940ed0cfebf765bee8f76f44 /src
parentお知らせメールを受け取るかどうかの設定を追加 (diff)
downloadsharkey-871d2bad17e5060c3d970b3dab3cb5434abccee6.tar.gz
sharkey-871d2bad17e5060c3d970b3dab3cb5434abccee6.tar.bz2
sharkey-871d2bad17e5060c3d970b3dab3cb5434abccee6.zip
Improve contextmenu handling
Diffstat (limited to 'src')
-rw-r--r--src/client/components/global/url.vue1
-rw-r--r--src/client/ui/deck/main-column.vue7
-rw-r--r--src/client/ui/default.vue7
3 files changed, 15 insertions, 0 deletions
diff --git a/src/client/components/global/url.vue b/src/client/components/global/url.vue
index c7e93094f5..2650cd33fd 100644
--- a/src/client/components/global/url.vue
+++ b/src/client/components/global/url.vue
@@ -2,6 +2,7 @@
<component :is="self ? 'MkA' : 'a'" class="ieqqeuvs _link" :[attr]="self ? url.substr(local.length) : url" :rel="rel" :target="target"
@mouseover="onMouseover"
@mouseleave="onMouseleave"
+ @contextmenu.stop="() => {}"
>
<template v-if="!self">
<span class="schema">{{ schema }}//</span>
diff --git a/src/client/ui/deck/main-column.vue b/src/client/ui/deck/main-column.vue
index f0d5567b6e..6d798c130c 100644
--- a/src/client/ui/deck/main-column.vue
+++ b/src/client/ui/deck/main-column.vue
@@ -57,6 +57,13 @@ export default defineComponent({
},
onContextmenu(e) {
+ const isLink = (el: HTMLElement) => {
+ if (el.tagName === 'A') return true;
+ if (el.parentElement) {
+ return isLink(el.parentElement);
+ }
+ };
+ if (isLink(e.target)) return;
if (['INPUT', 'TEXTAREA'].includes(e.target.tagName) || e.target.attributes['contenteditable']) return;
if (window.getSelection().toString() !== '') return;
const path = this.$route.path;
diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue
index 7626ddaa58..220dee9d6d 100644
--- a/src/client/ui/default.vue
+++ b/src/client/ui/default.vue
@@ -187,6 +187,13 @@ export default defineComponent({
},
onContextmenu(e) {
+ const isLink = (el: HTMLElement) => {
+ if (el.tagName === 'A') return true;
+ if (el.parentElement) {
+ return isLink(el.parentElement);
+ }
+ };
+ if (isLink(e.target)) return;
if (['INPUT', 'TEXTAREA'].includes(e.target.tagName) || e.target.attributes['contenteditable']) return;
if (window.getSelection().toString() !== '') return;
const path = this.$route.path;