aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-05-08 10:46:00 +0300
committerShpuld Shpuldson <shp@cock.li>2020-05-08 10:46:00 +0300
commitddc3b86d24249021cc1634dbdfb476684265f293 (patch)
tree2ccdaa44fa17aee1b4251d783cecff53ff7581c2
parent41fc26869f4ce9e93da94f1e441c69e2e37b0124 (diff)
fix popover not closing on pressing the buttons
-rw-r--r--src/components/extra_buttons/extra_buttons.js8
-rw-r--r--src/components/extra_buttons/extra_buttons.vue13
2 files changed, 11 insertions, 10 deletions
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index e1bf7e20..e4b19d01 100644
--- a/src/components/extra_buttons/extra_buttons.js
+++ b/src/components/extra_buttons/extra_buttons.js
@@ -3,11 +3,6 @@ import Popover from '../popover/popover.vue'
const ExtraButtons = {
props: [ 'status' ],
components: { Popover },
- data: function () {
- return {
- statusLink: `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
- }
- },
methods: {
deleteStatus () {
const confirmed = window.confirm(this.$t('status.delete_confirm'))
@@ -56,6 +51,9 @@ const ExtraButtons = {
},
canMute () {
return !!this.currentUser
+ },
+ statusLink () {
+ return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
}
}
}
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
index c785a180..bca93ea7 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -4,7 +4,10 @@
placement="top"
class="extra-button-popover"
>
- <div slot="content">
+ <div
+ slot="content"
+ slot-scope="{close}"
+ >
<div class="dropdown-menu">
<button
v-if="canMute && !status.thread_muted"
@@ -22,32 +25,32 @@
</button>
<button
v-if="!status.pinned && canPin"
- v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="pinStatus"
+ @click="close"
>
<i class="icon-pin" /><span>{{ $t("status.pin") }}</span>
</button>
<button
v-if="status.pinned && canPin"
- v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="unpinStatus"
+ @click="close"
>
<i class="icon-pin" /><span>{{ $t("status.unpin") }}</span>
</button>
<button
v-if="canDelete"
- v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="deleteStatus"
+ @click="close"
>
<i class="icon-cancel" /><span>{{ $t("status.delete") }}</span>
</button>
<button
- v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="copyLink"
+ @click="close"
>
<i class="icon-share" /><span>{{ $t("status.copy_link") }}</span>
</button>