Compare commits

..

No commits in common. "4af0c1ca1bca937f16d1a70837487a812de26b52" and "eba8d81625d621f07aa4b2d7c6e33f69be0f0902" have entirely different histories.

4 changed files with 8 additions and 18 deletions

View File

@ -31,22 +31,19 @@ import MkModal from '@/components/ui/modal.vue';
import MkEmojiPicker from '@/components/emoji-picker.vue';
import { defaultStore } from '@/store';
const props = withDefaults(defineProps<{
withDefaults(defineProps<{
manualShowing?: boolean | null;
src?: HTMLElement;
showPinned?: boolean;
asReactionPicker?: boolean;
multiple?: boolean;
}>(), {
manualShowing: null,
showPinned: true,
asReactionPicker: false,
multiple: false,
});
const emit = defineEmits<{
(ev: 'done', v: any): void;
(ev: 'chosen', v: any): void;
(ev: 'close'): void;
(ev: 'closed'): void;
}>();
@ -55,13 +52,9 @@ const modal = ref<InstanceType<typeof MkModal>>();
const picker = ref<InstanceType<typeof MkEmojiPicker>>();
function chosen(emoji: any) {
if (props.multiple) {
emit('chosen', emoji);
} else {
emit('done', emoji);
modal.value?.close();
}
}
function opening() {
picker.value?.reset();

View File

@ -1,6 +1,6 @@
<template>
<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 }}
</p>
<ul>
@ -12,7 +12,7 @@
</button>
</li>
</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>
<MkSwitch v-model="multiple">{{ $ts._poll.canMultipleVote }}</MkSwitch>
<section>

View File

@ -457,20 +457,17 @@ export async function openEmojiPicker(src?: HTMLElement, opts, initialTextarea:
characterData: false,
});
openingEmojiPicker = await popup(import('@/components/emoji-picker-dialog.vue'), {
openingEmojiPicker = await popup(import('@/components/emoji-picker-window.vue'), {
src,
multiple: true,
...opts,
...opts
}, {
chosen: emoji => {
insertTextAtCursor(activeTextarea, emoji);
activeTextarea.blur();
},
closed: () => {
openingEmojiPicker!.dispose();
openingEmojiPicker = null;
observer.disconnect();
activeTextarea.focus();
}
});
}

View File

@ -20,7 +20,7 @@
<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"/>
<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"/>
<footer>
<div class="left">