#468 - hide status menu after action button is clicked

This commit is contained in:
dave 2019-04-14 22:27:16 -04:00 committed by taehoon
parent 075ddc34f1
commit 8095ce8f62
2 changed files with 13 additions and 1 deletions

View file

@ -7,11 +7,13 @@ const ExtraButtons = {
}, },
data () { data () {
return { return {
showDropDown: false showDropDown: false,
showPopper: true
} }
}, },
methods: { methods: {
deleteStatus () { deleteStatus () {
this.refreshPopper()
const confirmed = window.confirm(this.$t('status.delete_confirm')) const confirmed = window.confirm(this.$t('status.delete_confirm'))
if (confirmed) { if (confirmed) {
this.$store.dispatch('deleteStatus', { id: this.status.id }) this.$store.dispatch('deleteStatus', { id: this.status.id })
@ -21,6 +23,7 @@ const ExtraButtons = {
this.showDropDown = !this.showDropDown this.showDropDown = !this.showDropDown
}, },
pinStatus () { pinStatus () {
this.refreshPopper()
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => { this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
if (status.error) { if (status.error) {
this.$emit('onError', status.error) this.$emit('onError', status.error)
@ -30,9 +33,17 @@ const ExtraButtons = {
}) })
}, },
unpinStatus () { unpinStatus () {
this.refreshPopper()
this.$store.state.api.backendInteractor.unpinOwnStatus(this.status.id).then((status) => { this.$store.state.api.backendInteractor.unpinOwnStatus(this.status.id).then((status) => {
this.$store.dispatch('updatePinned', status) this.$store.dispatch('updatePinned', status)
}) })
},
refreshPopper () {
this.showPopper = false
this.showDropDown = false
setTimeout(() => {
this.showPopper = true
})
} }
}, },
computed: { computed: {

View file

@ -3,6 +3,7 @@
trigger="click" trigger="click"
@hide='showDropDown = false' @hide='showDropDown = false'
append-to-body append-to-body
v-if="showPopper"
:options="{ :options="{
placement: 'top', placement: 'top',
modifiers: { modifiers: {