Page MenuHomePhorge

No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js
index 1033ba11c8..38258296e7 100644
--- a/src/components/post_status_modal/post_status_modal.js
+++ b/src/components/post_status_modal/post_status_modal.js
@@ -1,32 +1,49 @@
import PostStatusForm from '../post_status_form/post_status_form.vue'
+import get from 'lodash/get'
const PostStatusModal = {
components: {
PostStatusForm
},
+ data () {
+ return {
+ resettingForm: false
+ }
+ },
computed: {
isLoggedIn () {
return !!this.$store.state.users.currentUser
},
- isOpen () {
- return this.isLoggedIn && this.$store.state.postStatus.modalActivated
+ modalActivated () {
+ return this.$store.state.postStatus.modalActivated
+ },
+ isFormVisible () {
+ return this.isLoggedIn && !this.resettingForm && this.modalActivated
},
params () {
return this.$store.state.postStatus.params || {}
}
},
watch: {
- isOpen (val) {
+ params (newVal, oldVal) {
+ if (get(newVal, 'repliedUser.id') !== get(oldVal, 'repliedUser.id')) {
+ this.resettingForm = true
+ this.$nextTick(() => {
+ this.resettingForm = false
+ })
+ }
+ },
+ isFormVisible (val) {
if (val) {
- this.$nextTick(() => this.$el.querySelector('textarea').focus())
+ this.$nextTick(() => this.$el && this.$el.querySelector('textarea').focus())
}
}
},
methods: {
closeModal () {
this.$store.dispatch('closePostStatusModal')
}
}
}
export default PostStatusModal
diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue
index 3f8eec69b6..d3a823896b 100644
--- a/src/components/post_status_modal/post_status_modal.vue
+++ b/src/components/post_status_modal/post_status_modal.vue
@@ -1,43 +1,44 @@
<template>
<div
- v-if="isOpen"
+ v-if="isLoggedIn && !resettingForm"
+ v-show="modalActivated"
class="post-form-modal-view modal-view"
@click="closeModal"
>
<div
class="post-form-modal-panel panel"
@click.stop=""
>
<div class="panel-heading">
{{ $t('post_status.new_status') }}
</div>
<PostStatusForm
class="panel-body"
v-bind="params"
@posted="closeModal"
/>
</div>
</div>
</template>
<script src="./post_status_modal.js"></script>
<style lang="scss">
@import '../../_variables.scss';
.post-form-modal-view {
align-items: flex-start;
}
.post-form-modal-panel {
flex-shrink: 0;
margin-top: 25%;
margin-bottom: 2em;
width: 100%;
max-width: 700px;
@media (orientation: landscape) {
margin-top: 8%;
}
}
</style>

File Metadata

Mime Type
text/x-diff
Expires
Sat, Oct 10, 7:15 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1785092
Default Alt Text
(2 KB)

Event Timeline