Make status display controlled

This commit is contained in:
Tusooa Zhu 2021-08-07 10:28:45 -04:00
parent cd0f6a4f78
commit ace1f5067c
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
7 changed files with 130 additions and 5 deletions

View file

@ -28,7 +28,10 @@ const ThreadTree = {
threadDisplayStatus: Object,
showThreadRecursively: Function,
totalReplyCount: Object,
totalReplyDepth: Object
totalReplyDepth: Object,
statusContentProperties: Object,
setStatusContentProperty: Function,
toggleStatusContentProperty: Function
},
computed: {
reverseLookupTable () {
@ -44,6 +47,9 @@ const ThreadTree = {
},
threadShowing () {
return this.threadDisplayStatus[this.status.id] === 'showing'
},
currentProp () {
return this.statusContentProperties[this.status.id]
}
},
methods: {
@ -55,6 +61,9 @@ const ThreadTree = {
showThread () {
},
showAllSubthreads () {
},
toggleCurrentProp (name) {
this.toggleStatusContentProperty(this.status.id, name)
}
}
}

View file

@ -18,6 +18,13 @@
:controlled-thread-display-status="threadDisplayStatus[status.id]"
:controlled-toggle-thread-display="() => toggleThreadDisplay(status.id)"
:controlled-showing-tall="currentProp.showingTall"
:controlled-expanding-subject="currentProp.expandingSubject"
:controlled-showing-long-subject="currentProp.showingLongSubject"
:controlled-toggle-showing-tall="() => toggleCurrentProp('ShowingTall')"
:controlled-toggle-expanding-subject="() => toggleCurrentProp('expandingSubject')"
:controlled-toggle-showing-long-subject="() => toggleCurrentProp('showingLongSubject')"
@goto="setHighlight"
@toggleExpanded="toggleExpanded"
/>
@ -50,6 +57,9 @@
:show-thread-recursively="showThreadRecursively"
:total-reply-count="totalReplyCount"
:total-reply-depth="totalReplyDepth"
:status-content-properties="statusContentProperties"
:set-status-content-property="setStatusContentProperty"
:toggle-status-content-property="toggleStatusContentProperty"
/>
</div>
<div