Compare commits
No commits in common. "4af0c1ca1bca937f16d1a70837487a812de26b52" and "eba8d81625d621f07aa4b2d7c6e33f69be0f0902" have entirely different histories.
4af0c1ca1b
...
eba8d81625
|
@ -31,22 +31,19 @@ import MkModal from '@/components/ui/modal.vue';
|
||||||
import MkEmojiPicker from '@/components/emoji-picker.vue';
|
import MkEmojiPicker from '@/components/emoji-picker.vue';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
withDefaults(defineProps<{
|
||||||
manualShowing?: boolean | null;
|
manualShowing?: boolean | null;
|
||||||
src?: HTMLElement;
|
src?: HTMLElement;
|
||||||
showPinned?: boolean;
|
showPinned?: boolean;
|
||||||
asReactionPicker?: boolean;
|
asReactionPicker?: boolean;
|
||||||
multiple?: boolean;
|
|
||||||
}>(), {
|
}>(), {
|
||||||
manualShowing: null,
|
manualShowing: null,
|
||||||
showPinned: true,
|
showPinned: true,
|
||||||
asReactionPicker: false,
|
asReactionPicker: false,
|
||||||
multiple: false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'done', v: any): void;
|
(ev: 'done', v: any): void;
|
||||||
(ev: 'chosen', v: any): void;
|
|
||||||
(ev: 'close'): void;
|
(ev: 'close'): void;
|
||||||
(ev: 'closed'): void;
|
(ev: 'closed'): void;
|
||||||
}>();
|
}>();
|
||||||
|
@ -55,12 +52,8 @@ const modal = ref<InstanceType<typeof MkModal>>();
|
||||||
const picker = ref<InstanceType<typeof MkEmojiPicker>>();
|
const picker = ref<InstanceType<typeof MkEmojiPicker>>();
|
||||||
|
|
||||||
function chosen(emoji: any) {
|
function chosen(emoji: any) {
|
||||||
if (props.multiple) {
|
|
||||||
emit('chosen', emoji);
|
|
||||||
} else {
|
|
||||||
emit('done', emoji);
|
emit('done', emoji);
|
||||||
modal.value?.close();
|
modal.value?.close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function opening() {
|
function opening() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="zmdxowus">
|
<div class="zmdxowus">
|
||||||
<p v-if="choices.length < 2" class="caution">
|
<p v-if="poll.choices.length < 2" class="caution">
|
||||||
<i class="fas fa-exclamation-triangle"></i>{{ $ts._poll.noOnlyOneChoice }}
|
<i class="fas fa-exclamation-triangle"></i>{{ $ts._poll.noOnlyOneChoice }}
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<MkButton v-if="choices.length < 10" class="add" @click="add">{{ $ts.add }}</MkButton>
|
<MkButton v-if="poll.choices.length < 10" class="add" @click="add">{{ $ts.add }}</MkButton>
|
||||||
<MkButton v-else class="add" disabled>{{ $ts._poll.noMore }}</MkButton>
|
<MkButton v-else class="add" disabled>{{ $ts._poll.noMore }}</MkButton>
|
||||||
<MkSwitch v-model="multiple">{{ $ts._poll.canMultipleVote }}</MkSwitch>
|
<MkSwitch v-model="multiple">{{ $ts._poll.canMultipleVote }}</MkSwitch>
|
||||||
<section>
|
<section>
|
||||||
|
|
|
@ -457,20 +457,17 @@ export async function openEmojiPicker(src?: HTMLElement, opts, initialTextarea:
|
||||||
characterData: false,
|
characterData: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
openingEmojiPicker = await popup(import('@/components/emoji-picker-dialog.vue'), {
|
openingEmojiPicker = await popup(import('@/components/emoji-picker-window.vue'), {
|
||||||
src,
|
src,
|
||||||
multiple: true,
|
...opts
|
||||||
...opts,
|
|
||||||
}, {
|
}, {
|
||||||
chosen: emoji => {
|
chosen: emoji => {
|
||||||
insertTextAtCursor(activeTextarea, emoji);
|
insertTextAtCursor(activeTextarea, emoji);
|
||||||
activeTextarea.blur();
|
|
||||||
},
|
},
|
||||||
closed: () => {
|
closed: () => {
|
||||||
openingEmojiPicker!.dispose();
|
openingEmojiPicker!.dispose();
|
||||||
openingEmojiPicker = null;
|
openingEmojiPicker = null;
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
activeTextarea.focus();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<input v-show="useCw" ref="cw" v-model="cw" class="cw" :placeholder="$ts.annotation" @keydown="onKeydown">
|
<input v-show="useCw" ref="cw" v-model="cw" class="cw" :placeholder="$ts.annotation" @keydown="onKeydown">
|
||||||
<textarea ref="text" v-model="text" class="text" :class="{ withCw: useCw }" :disabled="posting" :placeholder="placeholder" @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/>
|
<textarea ref="text" v-model="text" class="text" :class="{ withCw: useCw }" :disabled="posting" :placeholder="placeholder" @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/>
|
||||||
<XPostFormAttaches class="attaches" :files="files" @updated="updateFiles" @detach="detachFile" @changeSensitive="updateFileSensitive" @changeName="updateFileName"/>
|
<XPostFormAttaches class="attaches" :files="files" @updated="updateFiles" @detach="detachFile" @changeSensitive="updateFileSensitive" @changeName="updateFileName"/>
|
||||||
<XPollEditor v-if="poll" v-model="poll" @destroyed="poll = null"/>
|
<XPollEditor v-if="poll" :poll="poll" @destroyed="poll = null" @updated="onPollUpdate"/>
|
||||||
<XNotePreview v-if="showPreview" class="preview" :text="text"/>
|
<XNotePreview v-if="showPreview" class="preview" :text="text"/>
|
||||||
<footer>
|
<footer>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
|
|
Loading…
Reference in New Issue