This commit is contained in:
syuilo 2022-01-18 21:35:57 +09:00
parent 9869f01e7c
commit a8fad1b61c
8 changed files with 24 additions and 24 deletions

View file

@ -167,15 +167,15 @@ export default defineComponent({
if (window._scroll) window._scroll();
},
onContextmenu(e) {
onContextmenu(ev: MouseEvent) {
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', 'IMG', 'VIDEO', 'CANVAS'].includes(e.target.tagName) || e.target.attributes['contenteditable']) return;
if (isLink(ev.target)) return;
if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(ev.target.tagName) || ev.target.attributes['contenteditable']) return;
if (window.getSelection().toString() !== '') return;
const path = this.$route.path;
os.contextMenu([{
@ -193,7 +193,7 @@ export default defineComponent({
action: () => {
os.pageWindow(path);
}
}], e);
}], ev);
},
onAiClick(ev) {