summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2019-10-15 16:00:43 +0200
committerRobin Appelman <robin@icewind.nl>2020-10-13 23:53:40 +0200
commitd8792993d4ebf3bb545508a2174a16d68c82b74c (patch)
treec12104cb0f334f572078853cc22941e2766f4396
parent265c2686a2e452d4d7e21742aa652219ac06a973 (diff)
IMPROVEMENT: In single-post timeline, automaticaly hide the composer when
clicking its close ('x') icon. Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
-rw-r--r--src/components/Composer.vue7
-rw-r--r--src/store/timeline.js3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/components/Composer.vue b/src/components/Composer.vue
index d039f38a..f1c0121f 100644
--- a/src/components/Composer.vue
+++ b/src/components/Composer.vue
@@ -39,7 +39,7 @@
<span>In reply to</span>
<actor-avatar :actor="replyTo.actor_info" :size="16" />
<strong>{{ replyTo.actor_info.account }}</strong>
- <a class="icon-close" @click="replyTo=null" />
+ <a class="icon-close" @click="closeReply()" />
</p>
<div class="reply-to-preview">
{{ replyTo.content }}
@@ -830,6 +830,11 @@ export default {
})
},
+ closeReply() {
+ this.replyTo = null
+ // View may want to hide the composer
+ this.$store.commit('setComposerDisplayStatus', false)
+ },
remoteSearchAccounts(text) {
return axios.get(generateUrl('apps/social/api/v1/global/accounts/search?search=' + text))
},
diff --git a/src/store/timeline.js b/src/store/timeline.js
index 0bb4aa01..031f3306 100644
--- a/src/store/timeline.js
+++ b/src/store/timeline.js
@@ -48,7 +48,8 @@ const state = {
*/
params: {},
account: '',
- /* Tells whether the composer should be displayed or not
+ /* Tells whether the composer should be displayed or not.
+ * It's up to the view to honor this status or not.
* @member {boolean}
*/
composerDisplayStatus: false