diff options
Diffstat (limited to 'src/client/components')
| -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/notes.vue | 11 | ||||
| -rw-r--r-- | src/client/components/post-form.vue | 8 | ||||
| -rw-r--r-- | src/client/components/ui/modal.vue | 1 |
5 files changed, 29 insertions, 7 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/notes.vue b/src/client/components/notes.vue index bd6d5bb4f5..332f00e5db 100644 --- a/src/client/components/notes.vue +++ b/src/client/components/notes.vue @@ -8,10 +8,10 @@ <MkError v-if="error" @retry="init()"/> <div v-show="more && reversed" style="margin-bottom: var(--margin);"> - <button class="_buttonPrimary" @click="fetchMoreFeature" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }"> + <MkButton style="margin: 0 auto;" @click="fetchMoreFeature" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }"> <template v-if="!moreFetching">{{ $ts.loadMore }}</template> <template v-if="moreFetching"><MkLoading inline/></template> - </button> + </MkButton> </div> <XList ref="notes" :items="notes" v-slot="{ item: note }" :direction="reversed ? 'up' : 'down'" :reversed="reversed"> @@ -19,10 +19,10 @@ </XList> <div v-show="more && !reversed" style="margin-top: var(--margin);"> - <button class="_buttonPrimary" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }"> + <MkButton style="margin: 0 auto;" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }"> <template v-if="!moreFetching">{{ $ts.loadMore }}</template> <template v-if="moreFetching"><MkLoading inline/></template> - </button> + </MkButton> </div> </div> </template> @@ -32,10 +32,11 @@ import { defineComponent } from 'vue'; import paging from '@/scripts/paging'; import XNote from './note.vue'; import XList from './date-separated-list.vue'; +import MkButton from '@/components/ui/button.vue'; export default defineComponent({ components: { - XNote, XList, + XNote, XList, MkButton, }, mixins: [ diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index fa9aeff8af..7849095ba8 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -70,6 +70,7 @@ import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; import { isMobile } from '@/scripts/is-mobile'; +import { throttle } from 'throttle-debounce'; export default defineComponent({ components: { @@ -144,6 +145,11 @@ export default defineComponent({ quoteId: null, recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'), imeText: '', + typing: throttle(3000, () => { + if (this.channel) { + os.stream.send('typingOnChannel', { channel: this.channel.id }); + } + }), postFormActions, faReply, faQuoteRight, faPaperPlane, faTimes, faUpload, faPollH, faGlobe, faHome, faUnlock, faEnvelope, faEyeSlash, faLaughSquint, faPlus, faPhotoVideo, faAt, faBiohazard, faPlug }; @@ -434,10 +440,12 @@ export default defineComponent({ onKeydown(e: KeyboardEvent) { if ((e.which === 10 || e.which === 13) && (e.ctrlKey || e.metaKey) && this.canPost) this.post(); if (e.which === 27) this.$emit('esc'); + this.typing(); }, onCompositionUpdate(e: CompositionEvent) { this.imeText = e.data; + this.typing(); }, onCompositionEnd(e: CompositionEvent) { 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; |