Commit 8095ce8f authored by Dave LiPuma's avatar Dave LiPuma Committed by Tae Hoon

#468 - hide status menu after action button is clicked

parent 075ddc34
......@@ -7,11 +7,13 @@ const ExtraButtons = {
},
data () {
return {
showDropDown: false
showDropDown: false,
showPopper: true
}
},
methods: {
deleteStatus () {
this.refreshPopper()
const confirmed = window.confirm(this.$t('status.delete_confirm'))
if (confirmed) {
this.$store.dispatch('deleteStatus', { id: this.status.id })
......@@ -21,6 +23,7 @@ const ExtraButtons = {
this.showDropDown = !this.showDropDown
},
pinStatus () {
this.refreshPopper()
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
if (status.error) {
this.$emit('onError', status.error)
......@@ -30,9 +33,17 @@ const ExtraButtons = {
})
},
unpinStatus () {
this.refreshPopper()
this.$store.state.api.backendInteractor.unpinOwnStatus(this.status.id).then((status) => {
this.$store.dispatch('updatePinned', status)
})
},
refreshPopper () {
this.showPopper = false
this.showDropDown = false
setTimeout(() => {
this.showPopper = true
})
}
},
computed: {
......
......@@ -3,6 +3,7 @@
trigger="click"
@hide='showDropDown = false'
append-to-body
v-if="showPopper"
:options="{
placement: 'top',
modifiers: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment