This commit is contained in:
Henry Jameson 2019-07-29 00:10:43 +03:00
parent 03c2f29b0a
commit fd66afe1e5
4 changed files with 60 additions and 33 deletions

View file

@ -67,7 +67,7 @@ const EmojiInput = {
caret: 0,
focused: false,
blurTimeout: null,
showPicker: false,
showPicker: false
}
},
components: {

View file

@ -1,21 +1,21 @@
<template>
<div
class="emoji-input"
v-click-outside="onClickOutside"
class="emoji-input"
>
<slot />
<template v-if="emojiPicker">
<div
@click.prevent="togglePicker"
class="emoji-picker-icon"
:class="pickerIconBottom ? 'picker-icon-bottom': 'picker-icon-right'"
@click.prevent="togglePicker"
>
<i class="icon-smile"></i>
<i class="icon-smile" />
</div>
<EmojiPicker
v-if="emojiPicker"
:class="{ hide: !showPicker }"
ref="picker"
:class="{ hide: !showPicker }"
class="emoji-picker-panel"
@emoji="insert"
/>

View file

@ -1,17 +1,41 @@
<template>
<div class="emoji-dropdown-menu panel panel-default">
<div class="panel-heading emoji-tabs">
<span class="emoji-tabs-item" :class="{'active': activeGroup === key}" v-for="(value, key) in emojis" :key="key" :title="value.text" @click.prevent="highlight(key)">
<i :class="value.icon"></i>
<span
v-for="(value, key) in emojis"
:key="key"
class="emoji-tabs-item"
:class="{'active': activeGroup === key}"
:title="value.text"
@click.prevent="highlight(key)"
>
<i :class="value.icon" />
</span>
</div>
<div class="panel-body emoji-dropdown-menu-content">
<div class="emoji-search">
<input type="text" class="form-control" v-model="keyword" />
<input
v-model="keyword"
type="text"
class="form-control"
>
</div>
<div class="emoji-groups" ref="emoji-groups" @scroll="scrolledGroup">
<div v-for="(value, key) in emojis" :key="key" class="emoji-group">
<h6 class="emoji-group-title" :ref="'group-' + key">{{value.text}}</h6>
<div
ref="emoji-groups"
class="emoji-groups"
@scroll="scrolledGroup"
>
<div
v-for="(value, key) in emojis"
:key="key"
class="emoji-group"
>
<h6
:ref="'group-' + key"
class="emoji-group-title"
>
{{ value.text }}
</h6>
<span
v-for="emoji in value.emojis"
:key="key + emoji.displayText"
@ -20,7 +44,10 @@
@click="onEmoji(emoji)"
>
<span v-if="!emoji.imageUrl">{{ emoji.replacement }}</span>
<img :src="emoji.imageUrl" v-else>
<img
v-else
:src="emoji.imageUrl"
>
</span>
</div>
</div>

View file

@ -61,7 +61,7 @@
<EmojiInput
v-if="newStatus.spoilerText || alwaysShowSubject"
v-model="newStatus.spoilerText"
emojiPicker
emoji-picker
:suggest="emojiSuggestor"
class="form-control"
>
@ -76,7 +76,7 @@
<EmojiInput
v-model="newStatus.status"
:suggest="emojiUserSuggestor"
emojiPicker
emoji-picker
class="form-control main-input"
>
<textarea