From 8668bc2609e82f64984b8a347a207668e3e4765b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 20 Feb 2021 16:16:19 +0900 Subject: 右クリックでリアクションピッカーを開くオプション MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/note-detailed.vue | 8 +++++++- src/client/components/note.vue | 8 +++++++- src/client/components/ui/modal.vue | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/client/components') diff --git a/src/client/components/note-detailed.vue b/src/client/components/note-detailed.vue index 1108bd2c27..434dd56ba3 100644 --- a/src/client/components/note-detailed.vue +++ b/src/client/components/note-detailed.vue @@ -756,7 +756,13 @@ export default defineComponent({ }; if (isLink(e.target)) return; if (window.getSelection().toString() !== '') return; - os.contextMenu(this.getMenu(), e).then(this.focus); + + if (this.$store.state.useReactionPickerForContextMenu) { + e.preventDefault(); + this.react(); + } else { + os.contextMenu(this.getMenu(), e).then(this.focus); + } }, menu(viaKeyboard = false) { diff --git a/src/client/components/note.vue b/src/client/components/note.vue index d532289857..24c374869d 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -731,7 +731,13 @@ export default defineComponent({ }; if (isLink(e.target)) return; if (window.getSelection().toString() !== '') return; - os.contextMenu(this.getMenu(), e).then(this.focus); + + if (this.$store.state.useReactionPickerForContextMenu) { + e.preventDefault(); + this.react(); + } else { + os.contextMenu(this.getMenu(), e).then(this.focus); + } }, menu(viaKeyboard = false) { diff --git a/src/client/components/ui/modal.vue b/src/client/components/ui/modal.vue index 69a83e002c..405fa4aaa5 100644 --- a/src/client/components/ui/modal.vue +++ b/src/client/components/ui/modal.vue @@ -70,6 +70,7 @@ export default defineComponent({ // TODO: ResizeObserver無くしたい new ResizeObserver((entries, observer) => { const rect = this.src.getBoundingClientRect(); + const width = popover.offsetWidth; const height = popover.offsetHeight; -- cgit v1.2.3-freya