From 8872b4802e2b0dff25eaaf884884d740ed016c98 Mon Sep 17 00:00:00 2001
From: Henry Jameson
Date: Sat, 8 Jun 2019 16:23:58 +0300
Subject: standartized autocomplete panel suggesions format, fixed some bugs
---
.../post_status_form/post_status_form.js | 37 ----------------------
.../post_status_form/post_status_form.vue | 18 +++++++----
2 files changed, 12 insertions(+), 43 deletions(-)
(limited to 'src/components/post_status_form')
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 1516dd43..008b821a 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -83,43 +83,6 @@ const PostStatusForm = {
}
},
computed: {
- candidates () {
- const firstchar = this.textAtCaret.charAt(0)
- if (firstchar === '@') {
- const query = this.textAtCaret.slice(1).toUpperCase()
- const matchedUsers = filter(this.users, (user) => {
- return user.screen_name.toUpperCase().startsWith(query) ||
- user.name && user.name.toUpperCase().startsWith(query)
- })
- if (matchedUsers.length <= 0) {
- return false
- }
- // eslint-disable-next-line camelcase
- return map(take(matchedUsers, 5), ({screen_name, name, profile_image_url_original}, index) => ({
- // eslint-disable-next-line camelcase
- screen_name: `@${screen_name}`,
- name: name,
- img: profile_image_url_original,
- highlighted: index === this.highlighted
- }))
- } else if (firstchar === ':') {
- if (this.textAtCaret === ':') { return }
- const matchedEmoji = filter(this.emoji.concat(this.customEmoji), (emoji) => emoji.shortcode.startsWith(this.textAtCaret.slice(1)))
- if (matchedEmoji.length <= 0) {
- return false
- }
- return map(take(matchedEmoji, 5), ({shortcode, image_url, utf}, index) => ({
- screen_name: `:${shortcode}:`,
- name: '',
- utf: utf || '',
- // eslint-disable-next-line camelcase
- img: utf ? '' : this.$store.state.instance.server + image_url,
- highlighted: index === this.highlighted
- }))
- } else {
- return false
- }
- },
users () {
return this.$store.state.users.users
},
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 507b14bf..a8a34265 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -32,24 +32,29 @@
{{ $t('post_status.direct_warning_to_all') }}
-
+
@@ -251,7 +257,7 @@
min-height: 1px;
}
- form textarea.form-control {
+ .form-post-body {
line-height:16px;
resize: none;
overflow: hidden;
@@ -260,7 +266,7 @@
box-sizing: content-box;
}
- form textarea.form-control:focus {
+ .form-post-body:focus {
min-height: 48px;
}
--
cgit v1.2.3-70-g09d2