diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-07-26 12:44:32 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-07-26 12:44:32 +0000 |
| commit | d3f6b581d1bbe64d26fceae3f00e9d471ca44dfe (patch) | |
| tree | 371e786ac95c83d914aa04f22aa9aabfb7b5dc4a /src/components/post_status_form | |
| parent | 3370dd80dc4644f2bff053b97b18698cd2abb550 (diff) | |
| parent | 4827e4d972f8ee11e606693e24ae4ca21711c6b1 (diff) | |
Merge branch 'develop' into 'feat/conversation-muting'
# Conflicts:
# src/components/extra_buttons/extra_buttons.js
# src/components/extra_buttons/extra_buttons.vue
Diffstat (limited to 'src/components/post_status_form')
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 24 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 24 |
2 files changed, 44 insertions, 4 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index ef6b0fce..40bbf6d4 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -3,6 +3,7 @@ import MediaUpload from '../media_upload/media_upload.vue' import ScopeSelector from '../scope_selector/scope_selector.vue' import EmojiInput from '../emoji-input/emoji-input.vue' import PollForm from '../poll/poll_form.vue' +import StickerPicker from '../sticker_picker/sticker_picker.vue' import fileTypeService from '../../services/file_type/file_type.service.js' import { reject, map, uniqBy } from 'lodash' import suggestor from '../emoji-input/suggestor.js' @@ -34,6 +35,7 @@ const PostStatusForm = { MediaUpload, EmojiInput, PollForm, + StickerPicker, ScopeSelector }, mounted () { @@ -82,7 +84,8 @@ const PostStatusForm = { contentType }, caret: 0, - pollFormVisible: false + pollFormVisible: false, + stickerPickerVisible: false } }, computed: { @@ -104,7 +107,8 @@ const PostStatusForm = { ...this.$store.state.instance.emoji, ...this.$store.state.instance.customEmoji ], - users: this.$store.state.users.users + users: this.$store.state.users.users, + updateUsersList: (input) => this.$store.dispatch('searchUsers', input) }) }, emojiSuggestor () { @@ -157,6 +161,12 @@ const PostStatusForm = { safeDMEnabled () { return this.$store.state.instance.safeDM }, + stickersAvailable () { + if (this.$store.state.instance.stickers) { + return this.$store.state.instance.stickers.length > 0 + } + return 0 + }, pollsAvailable () { return this.$store.state.instance.pollsAvailable && this.$store.state.instance.pollLimits.max_options >= 2 @@ -212,6 +222,7 @@ const PostStatusForm = { poll: {} } this.pollFormVisible = false + this.stickerPickerVisible = false this.$refs.mediaUpload.clearFile() this.clearPollForm() this.$emit('posted') @@ -228,6 +239,7 @@ const PostStatusForm = { addMediaFile (fileInfo) { this.newStatus.files.push(fileInfo) this.enableSubmit() + this.stickerPickerVisible = false }, removeMediaFile (fileInfo) { let index = this.newStatus.files.indexOf(fileInfo) @@ -287,6 +299,14 @@ const PostStatusForm = { changeVis (visibility) { this.newStatus.visibility = visibility }, + toggleStickerPicker () { + this.stickerPickerVisible = !this.stickerPickerVisible + }, + clearStickerPicker () { + if (this.$refs.stickerPicker) { + this.$refs.stickerPicker.clear() + } + }, togglePollForm () { this.pollFormVisible = !this.pollFormVisible }, diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 1f389eda..d29d47e4 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -158,6 +158,17 @@ @upload-failed="uploadFailed" /> <div + v-if="stickersAvailable" + class="sticker-icon" + > + <i + :title="$t('stickers.add_sticker')" + class="icon-picture btn btn-default" + :class="{ selected: stickerPickerVisible }" + @click="toggleStickerPicker" + /> + </div> + <div v-if="pollsAvailable" class="poll-icon" > @@ -169,7 +180,6 @@ /> </div> </div> - <button v-if="posting" disabled @@ -248,6 +258,11 @@ <label for="filesSensitive">{{ $t('post_status.attachments_sensitive') }}</label> </div> </form> + <sticker-picker + v-if="stickerPickerVisible" + ref="stickerPicker" + @uploaded="addMediaFile" + /> </div> </template> @@ -310,7 +325,7 @@ } } - .poll-icon { + .poll-icon, .sticker-icon { font-size: 26px; flex: 1; @@ -320,6 +335,11 @@ } } + .sticker-icon { + flex: 0; + min-width: 50px; + } + .icon-chart-bar { cursor: pointer; } |
