diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2021-02-20 16:16:19 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2021-02-20 16:16:19 +0900 |
| commit | 8668bc2609e82f64984b8a347a207668e3e4765b (patch) | |
| tree | a41740a124774c58e96dfe3445bb46d1665ca8be /src/client | |
| parent | Improve widget performance (diff) | |
| download | sharkey-8668bc2609e82f64984b8a347a207668e3e4765b.tar.gz sharkey-8668bc2609e82f64984b8a347a207668e3e4765b.tar.bz2 sharkey-8668bc2609e82f64984b8a347a207668e3e4765b.zip | |
右クリックでリアクションピッカーを開くオプション
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/components/note-detailed.vue | 8 | ||||
| -rw-r--r-- | src/client/components/note.vue | 8 | ||||
| -rw-r--r-- | src/client/components/ui/modal.vue | 1 | ||||
| -rw-r--r-- | src/client/pages/settings/general.vue | 2 | ||||
| -rw-r--r-- | src/client/store.ts | 4 | ||||
| -rw-r--r-- | src/client/ui/chat/note.vue | 8 |
6 files changed, 28 insertions, 3 deletions
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; diff --git a/src/client/pages/settings/general.vue b/src/client/pages/settings/general.vue index 0e741d474c..90ff3e2c20 100644 --- a/src/client/pages/settings/general.vue +++ b/src/client/pages/settings/general.vue @@ -19,6 +19,7 @@ <template #label>{{ $ts.behavior }}</template> <FormSwitch v-model:value="imageNewTab">{{ $ts.openImageInNewTab }}</FormSwitch> <FormSwitch v-model:value="enableInfiniteScroll">{{ $ts.enableInfiniteScroll }}</FormSwitch> + <FormSwitch v-model:value="useReactionPickerForContextMenu">{{ $ts.useReactionPickerForContextMenu }}</FormSwitch> <FormSwitch v-model:value="disablePagesScript">{{ $ts.disablePagesScript }}</FormSwitch> </FormGroup> @@ -144,6 +145,7 @@ export default defineComponent({ chatOpenBehavior: ColdDeviceStorage.makeGetterSetter('chatOpenBehavior'), instanceTicker: defaultStore.makeGetterSetter('instanceTicker'), enableInfiniteScroll: defaultStore.makeGetterSetter('enableInfiniteScroll'), + useReactionPickerForContextMenu: defaultStore.makeGetterSetter('useReactionPickerForContextMenu'), }, watch: { diff --git a/src/client/store.ts b/src/client/store.ts index bf042d8ab4..528e563fdd 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -144,6 +144,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true }, + useReactionPickerForContextMenu: { + where: 'device', + default: true + }, showGapBetweenNotesInTimeline: { where: 'device', default: true diff --git a/src/client/ui/chat/note.vue b/src/client/ui/chat/note.vue index f4c9f063dc..4e4a303c36 100644 --- a/src/client/ui/chat/note.vue +++ b/src/client/ui/chat/note.vue @@ -741,7 +741,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) { |