diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-08 18:46:39 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-08 18:46:39 +0900 |
| commit | 190b47aad28c2d6e740953ffd7f987225c67f0a3 (patch) | |
| tree | bda0ce27a77dcabf991317f07faf654c6509ec7a /packages/client/src/components | |
| parent | Update CHANGELOG.md (diff) | |
| download | misskey-190b47aad28c2d6e740953ffd7f987225c67f0a3.tar.gz misskey-190b47aad28c2d6e740953ffd7f987225c67f0a3.tar.bz2 misskey-190b47aad28c2d6e740953ffd7f987225c67f0a3.zip | |
feat(client): デバイスの種類を手動指定できるように
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/emoji-picker.vue | 4 | ||||
| -rw-r--r-- | packages/client/src/components/ui/modal.vue | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/packages/client/src/components/emoji-picker.vue b/packages/client/src/components/emoji-picker.vue index 6999ad6517..3e1208979f 100644 --- a/packages/client/src/components/emoji-picker.vue +++ b/packages/client/src/components/emoji-picker.vue @@ -81,7 +81,7 @@ import { getStaticImageUrl } from '@/scripts/get-static-image-url'; import Ripple from '@/components/ripple.vue'; import * as os from '@/os'; import { isTouchUsing } from '@/scripts/touch'; -import { isMobile } from '@/scripts/is-mobile'; +import { deviceKind } from '@/scripts/device-kind'; import { emojiCategories, instance } from '@/instance'; import XSection from './emoji-picker.section.vue'; import { i18n } from '@/i18n'; @@ -263,7 +263,7 @@ watch(q, () => { }); function focus() { - if (!isMobile && !isTouchUsing) { + if (!['smartphone', 'tablet'].includes(deviceKind) && !isTouchUsing) { search.value?.focus({ preventScroll: true }); diff --git a/packages/client/src/components/ui/modal.vue b/packages/client/src/components/ui/modal.vue index 3c3bb5c226..b42c0e4d42 100644 --- a/packages/client/src/components/ui/modal.vue +++ b/packages/client/src/components/ui/modal.vue @@ -14,6 +14,7 @@ import { nextTick, onMounted, computed, ref, watch, provide } from 'vue'; import * as os from '@/os'; import { isTouchUsing } from '@/scripts/touch'; import { defaultStore } from '@/store'; +import { deviceKind } from '@/scripts/device-kind'; function getFixedContainer(el: Element | null): Element | null { if (el == null || el.tagName === 'BODY') return null; @@ -62,7 +63,7 @@ const content = ref<HTMLElement>(); const zIndex = os.claimZIndex(props.zPriority); const type = computed(() => { if (props.preferType === 'auto') { - if (!defaultStore.state.disableDrawer && isTouchUsing && window.innerWidth < 500 && window.innerHeight < 1000) { + if (!defaultStore.state.disableDrawer && isTouchUsing && deviceKind === 'smartphone') { return 'drawer'; } else { return props.src != null ? 'popup' : 'dialog'; |