Implement thread folding/expanding

This commit is contained in:
Tusooa Zhu 2021-08-07 00:33:06 -04:00
parent 0582f19e7c
commit 0f2fd8a352
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
6 changed files with 180 additions and 14 deletions

View file

@ -21,7 +21,14 @@ const ThreadTree = {
getHighlight: Function,
getReplies: Function,
setHighlight: Function,
toggleExpanded: Function
toggleExpanded: Function,
// to control display of the whole thread forest
toggleThreadDisplay: Function,
threadDisplayStatus: Object,
showThreadRecursively: Function,
totalReplyCount: Object,
totalReplyDepth: Object
},
computed: {
reverseLookupTable () {
@ -35,6 +42,9 @@ const ThreadTree = {
debug('getReplies:', this.getReplies(this.status.id))
return this.getReplies(this.status.id).map(({ id }) => this.statusById(id))
},
threadShowing () {
return this.threadDisplayStatus[this.status.id] === 'showing'
}
},
methods: {
statusById (id) {