2021-06-08 21:34:47 +10:00
|
|
|
import MentionLink from 'src/components/mention_link/mention_link.vue'
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
|
|
const MentionsLine = {
|
|
|
|
name: 'MentionsLine',
|
|
|
|
props: {
|
|
|
|
attentions: {
|
|
|
|
required: true,
|
2021-06-09 00:04:57 +10:00
|
|
|
type: Array
|
2021-06-08 21:34:47 +10:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data: () => ({ expanded: false }),
|
|
|
|
components: {
|
|
|
|
MentionLink
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
oldStyle () {
|
2021-06-08 21:51:42 +10:00
|
|
|
return !this.mergedConfig.mentionsNewStyle
|
2021-06-08 21:34:47 +10:00
|
|
|
},
|
|
|
|
limit () {
|
2021-06-08 21:36:41 +10:00
|
|
|
return 6
|
2021-06-08 21:34:47 +10:00
|
|
|
},
|
|
|
|
mentions () {
|
|
|
|
return this.attentions.slice(0, this.limit)
|
|
|
|
},
|
|
|
|
extraMentions () {
|
|
|
|
return this.attentions.slice(this.limit)
|
|
|
|
},
|
|
|
|
manyMentions () {
|
|
|
|
return this.extraMentions.length > 0
|
|
|
|
},
|
|
|
|
buttonClasses () {
|
|
|
|
return [
|
|
|
|
this.oldStyle
|
|
|
|
? 'button-unstyled'
|
|
|
|
: 'button-default -sublime',
|
|
|
|
this.oldStyle
|
|
|
|
? '-oldStyle'
|
|
|
|
: '-newStyle'
|
|
|
|
]
|
|
|
|
},
|
2021-06-08 21:51:42 +10:00
|
|
|
...mapGetters(['mergedConfig'])
|
2021-06-08 21:34:47 +10:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleShowMore () {
|
|
|
|
this.expanded = !this.expanded
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MentionsLine
|