aboutsummaryrefslogtreecommitdiff
path: root/src/components/mentions_line
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-08-15 16:27:41 +0300
committerHenry Jameson <me@hjkos.com>2021-08-15 16:27:41 +0300
commit17d2eed06a7c0c2a38129e36cca1e676c351abce (patch)
tree2521a727071db6f7cfe4e76f7e227dfe69b750d6 /src/components/mentions_line
parentb67db47c888dd45c49a49b82e7922c2bf40ed61c (diff)
parentf16658adfc897a3b07ed7f79d872acd2c3837cc8 (diff)
Merge branch 'better-still-emoji' into proper-attachments
* better-still-emoji: fix tests prevent infinite update loops remove obsolete tests removed useless code, review change, fixed bug with tall statuses fixed mentions line again remove old emoji added, everything emoji-bearing uses RichContent now richcontent support in polls, user cards and user profiles support richcontent in polls fix tests, add performance test (skipped, doesn't assert anything), tweak max mentions count made the code responsible for showing unwritten mentions actually work remove new options for style and separate line, now groups all chained mentions on a mentionsline regardless of placement. fixes spacing fix tests
Diffstat (limited to 'src/components/mentions_line')
-rw-r--r--src/components/mentions_line/mentions_line.js22
-rw-r--r--src/components/mentions_line/mentions_line.scss15
-rw-r--r--src/components/mentions_line/mentions_line.vue6
3 files changed, 10 insertions, 33 deletions
diff --git a/src/components/mentions_line/mentions_line.js b/src/components/mentions_line/mentions_line.js
index e52045ec..a4a0c724 100644
--- a/src/components/mentions_line/mentions_line.js
+++ b/src/components/mentions_line/mentions_line.js
@@ -1,6 +1,8 @@
import MentionLink from 'src/components/mention_link/mention_link.vue'
import { mapGetters } from 'vuex'
+export const MENTIONS_LIMIT = 5
+
const MentionsLine = {
name: 'MentionsLine',
props: {
@@ -14,31 +16,15 @@ const MentionsLine = {
MentionLink
},
computed: {
- oldStyle () {
- return !this.mergedConfig.mentionsNewStyle
- },
- limit () {
- return 6
- },
mentionsComputed () {
- return this.mentions.slice(0, this.limit)
+ return this.mentions.slice(0, MENTIONS_LIMIT)
},
extraMentions () {
- return this.mentions.slice(this.limit)
+ return this.mentions.slice(MENTIONS_LIMIT)
},
manyMentions () {
return this.extraMentions.length > 0
},
- buttonClasses () {
- return [
- this.oldStyle
- ? 'button-unstyled'
- : 'button-default -sublime',
- this.oldStyle
- ? '-oldStyle'
- : '-newStyle'
- ]
- },
...mapGetters(['mergedConfig'])
},
methods: {
diff --git a/src/components/mentions_line/mentions_line.scss b/src/components/mentions_line/mentions_line.scss
index 90d1e0a4..222940c8 100644
--- a/src/components/mentions_line/mentions_line.scss
+++ b/src/components/mentions_line/mentions_line.scss
@@ -1,17 +1,10 @@
.MentionsLine {
.showMoreLess {
white-space: normal;
+ color: var(--link);
+ }
- &.-newStyle {
- line-height: 1.5;
- font-size: inherit;
- display: inline-block;
- padding-top: 0;
- padding-bottom: 0;
- }
-
- &.-oldStyle {
- color: var(--link);
- }
+ .mention-link:not(:last-child) {
+ margin-right: 0.25em;
}
}
diff --git a/src/components/mentions_line/mentions_line.vue b/src/components/mentions_line/mentions_line.vue
index f4b3abb9..f375e3b0 100644
--- a/src/components/mentions_line/mentions_line.vue
+++ b/src/components/mentions_line/mentions_line.vue
@@ -25,15 +25,13 @@
/>
</span><button
v-if="!expanded"
- class="showMoreLess"
- :class="buttonClasses"
+ class="button-unstyled showMoreLess"
@click="toggleShowMore"
>
{{ $t('status.plus_more', { number: extraMentions.length }) }}
</button><button
v-if="expanded"
- class="showMoreLess"
- :class="buttonClasses"
+ class="button-unstyled showMoreLess"
@click="toggleShowMore"
>
{{ $t('general.show_less') }}