aboutsummaryrefslogtreecommitdiff
path: root/src/components/extra_buttons
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/extra_buttons')
-rw-r--r--src/components/extra_buttons/extra_buttons.js24
-rw-r--r--src/components/extra_buttons/extra_buttons.vue38
2 files changed, 15 insertions, 47 deletions
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index 56b2c41e..8d123293 100644
--- a/src/components/extra_buttons/extra_buttons.js
+++ b/src/components/extra_buttons/extra_buttons.js
@@ -1,35 +1,18 @@
-import Popper from 'vue-popperjs/src/component/popper.js.vue'
-
const ExtraButtons = {
props: [ 'status' ],
- components: {
- Popper
- },
- data () {
- return {
- 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 })
}
},
- toggleMenu () {
- this.showDropDown = !this.showDropDown
- },
pinStatus () {
- this.refreshPopper()
this.$store.dispatch('pinStatus', this.status.id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
},
unpinStatus () {
- this.refreshPopper()
this.$store.dispatch('unpinStatus', this.status.id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
@@ -45,13 +28,6 @@ const ExtraButtons = {
this.$store.dispatch('unmuteConversation', this.status.id)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
- },
- refreshPopper () {
- this.showPopper = false
- this.showDropDown = false
- setTimeout(() => {
- this.showPopper = true
- })
}
},
computed: {
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
index 5027be1b..fc800072 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -1,18 +1,13 @@
<template>
- <Popper
- v-if="showPopper"
+ <v-popover
+ v-if="enabled"
trigger="click"
- append-to-body
- :options="{
- placement: 'top',
- modifiers: {
- arrow: { enabled: true },
- offset: { offset: '0, 5px' },
- }
- }"
- @hide="showDropDown = false"
+ placement="top"
+ class="extra-button-popover"
+ :offset="5"
+ :container="false"
>
- <div class="popper-wrapper">
+ <div slot="popover">
<div class="dropdown-menu">
<button
v-if="!status.muted"
@@ -30,6 +25,7 @@
</button>
<button
v-if="!status.pinned && canPin"
+ v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="pinStatus"
>
@@ -37,6 +33,7 @@
</button>
<button
v-if="status.pinned && canPin"
+ v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="unpinStatus"
>
@@ -44,6 +41,7 @@
</button>
<button
v-if="canDelete"
+ v-close-popover
class="dropdown-item dropdown-item-icon"
@click.prevent="deleteStatus"
>
@@ -51,17 +49,10 @@
</button>
</div>
</div>
- <div
- slot="reference"
- class="button-icon"
- @click="toggleMenu"
- >
- <i
- class="icon-ellipsis"
- :class="{'icon-clicked': showDropDown}"
- />
+ <div class="button-icon">
+ <i class="icon-ellipsis" />
</div>
- </Popper>
+ </v-popover>
</template>
<script src="./extra_buttons.js" ></script>
@@ -73,7 +64,8 @@
.icon-ellipsis {
cursor: pointer;
- &:hover, &.icon-clicked {
+ &:hover,
+ .extra-button-popover.open & {
color: $fallback--text;
color: var(--text, $fallback--text);
}