Compare commits

..

No commits in common. "6baf0ec3392d8e1a740afcc5d99d203de16d9e9e" and "f246611aa2350d45db2d140badfd522153b04c82" have entirely different histories.

4 changed files with 11 additions and 9 deletions

View file

@ -62,6 +62,7 @@ export default {
'extra',
'status',
'funcArg',
'animationState',
'getClass',
'getComponent',
'doAction',
@ -72,9 +73,6 @@ export default {
EmojiPicker,
Popover
},
data: () => ({
animationState: false
}),
computed: {
buttonClass () {
return [
@ -118,11 +116,7 @@ export default {
if (button.name === 'emoji') {
this.$refs.picker.showPicker()
} else {
this.animationState = true
this.getComponent(button) === 'button' && this.doAction(button)
setTimeout(() => {
this.animationState = false
}, 500)
close()
}
}

View file

@ -19,8 +19,7 @@
<FAIcon
class="fa-scale-110"
:icon="button.icon(funcArg)"
:spin="!extra && button.animated?.() && animationState"
style="--fa-animation-duration: 750ms;"
:spin="!extra && button.animated?.() && animationState[button.name]"
fixed-width
/>
<template v-if="!buttonClass.disabled && button.toggleable?.(funcArg) && button.active">

View file

@ -21,6 +21,11 @@ const StatusActionButtons = {
emits: ['toggleReplying'],
data () {
return {
Popover,
animationState: {
retweet: false,
favorite: false
},
showPin: false,
showingConfirmDialog: false,
currentConfirmTitle: '',
@ -94,9 +99,11 @@ const StatusActionButtons = {
}
},
doActionReal (button) {
this.animationState[button.name] = true
button.action(this.funcArg)
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
.finally(() => setTimeout(() => { this.animationState[button.name] = false }))
},
onExtraClose () {
this.showPin = false

View file

@ -15,6 +15,7 @@
:funcArg="funcArg"
:get-class="getClass"
:get-component="getComponent"
:animation-state="animationState"
:close="() => {}"
:do-action="doAction"
/>
@ -83,6 +84,7 @@
:funcArg="funcArg"
:get-class="getClass"
:get-component="getComponent"
:animation-state="animationState"
:close="close"
:do-action="doAction"
/>