Skip to content

Commit fce2b7c

Browse files
committed
Merge branch 'master' into fix/change_UI_Setting_Qall
2 parents 0a6646c + 9e8f0d6 commit fce2b7c

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

build/gen-mplus.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ const getUrlFromSrc = src => {
7575
}
7676

7777
const generateFilename = font => {
78-
const i = getUrlFromSrc(font.src).match(/\/v\d+\/[^.]+\.(\d+)\.woff2/)
79-
if (!i) throw new Error(`Unexpected: ${getUrlFromSrc(font.src)}`)
8078
const family = font['font-family'].replace(/[' ]/g, '')
8179
const weight = font['font-weight'].replace(/[' ]/g, '')
82-
return `${family}.${weight}.${i[1]}.woff2`
80+
81+
const fontSrcWithId = getUrlFromSrc(font.src).match(/\/v\d+\/([^/]+)\.woff2/)
82+
if (!fontSrcWithId) {
83+
throw new Error(`Unexpected URL: ${getUrlFromSrc(font.src)}`)
84+
}
85+
return `${family}.${weight}.${fontSrcWithId[1]}.woff2`
8386
}
8487

8588
const downloadAndtransform = async (url, filename) => {

src/components/GroupManager/DesktopGroupManager.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const { openGroupCreateModal } = useGroupCreateModalOpener()
4141
scrollbar-gutter: stable;
4242
}
4343
.close {
44-
position: absolute;
44+
position: fixed;
4545
top: 30px;
4646
right: 60px;
4747
}

src/components/Modal/FileModal/FileModal.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,9 @@ const { clearModal } = useModalStore()
3939
<style module lang="scss">
4040
.fileContainer {
4141
height: 100%;
42+
display: flex;
43+
flex-direction: column;
44+
align-items: center;
45+
justify-content: center;
4246
}
4347
</style>

src/components/ShareTarget/ShareTargetMessageInput.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
<textarea
88
:id="id"
99
ref="textareaRef"
10-
v-model="state.text"
1110
:class="$style.input"
11+
:value="state.text"
12+
@input="event => state.text = (event.target as HTMLTextAreaElement).value"
1213
/>
1314
</div>
1415
<div :class="$style.controls">

src/components/UI/ClickOutside.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
cloneVNode,
77
shallowRef,
88
onMounted,
9-
onBeforeUnmount
9+
onBeforeUnmount,
10+
ref
1011
} from 'vue'
1112
import { isIOS } from '/@/lib/dom/browser'
1213
import { useModalStore } from '/@/store/ui/modal'
@@ -23,7 +24,8 @@ const filterChildren = <T extends VNode>(vnodes: T[]) =>
2324
return true
2425
})
2526

26-
const eventName = isIOS() ? 'touchend' : 'click'
27+
const startEventName = isIOS() ? 'touchstart' : 'mousedown'
28+
const endEventName = isIOS() ? 'touchend' : 'mouseup'
2729

2830
/**
2931
* そのデフォルトスロットに指定した要素の外でクリックされたときにclickOutsideイベントを発火する
@@ -51,8 +53,9 @@ export default defineComponent({
5153
const element = shallowRef<Element | ComponentPublicInstance>()
5254

5355
const { shouldShowModal } = useModalStore()
56+
const isMouseDown = ref(false)
5457

55-
const onClick = (e: MouseEvent | TouchEvent) => {
58+
const onMouseDown = (e: MouseEvent | TouchEvent) => {
5659
if (!element.value) return
5760

5861
if (props.unableWhileModalOpen && shouldShowModal.value) return
@@ -64,17 +67,36 @@ export default defineComponent({
6467
return
6568
}
6669

70+
isMouseDown.value = true
71+
if (props.stop) {
72+
e.stopPropagation()
73+
}
74+
}
75+
const onMouseUp = (e: MouseEvent | TouchEvent) => {
76+
if (!isMouseDown.value) return
77+
isMouseDown.value = false
78+
79+
if (!element.value) return
80+
const ele =
81+
element.value instanceof Element ? element.value : element.value.$el
82+
83+
if (ele === e.target || e.composedPath().includes(ele)) {
84+
return
85+
}
86+
6787
emit('clickOutside', e)
6888
if (props.stop) {
6989
e.stopPropagation()
7090
}
7191
}
7292

7393
onMounted(() => {
74-
window.addEventListener(eventName, onClick, { capture: true })
94+
window.addEventListener(startEventName, onMouseDown, { capture: true })
95+
window.addEventListener(endEventName, onMouseUp, { capture: true })
7596
})
7697
onBeforeUnmount(() => {
77-
window.removeEventListener(eventName, onClick, { capture: true })
98+
window.removeEventListener(startEventName, onMouseDown, { capture: true })
99+
window.removeEventListener(endEventName, onMouseUp, { capture: true })
78100
})
79101

80102
return () => {

0 commit comments

Comments
 (0)