add a spin animation to favorite and boost actions
This commit is contained in:
parent
ba4f7ef3ef
commit
459fdaf10f
4 changed files with 28 additions and 5 deletions
|
@ -1,16 +1,26 @@
|
|||
const RetweetButton = {
|
||||
props: [ 'status' ],
|
||||
props: ['status'],
|
||||
data () {
|
||||
return {
|
||||
animated: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
retweet () {
|
||||
if (!this.status.repeated) {
|
||||
this.$store.dispatch('retweet', {id: this.status.id})
|
||||
}
|
||||
this.animated = true
|
||||
setTimeout(() => {
|
||||
this.animated = false
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classes () {
|
||||
return {
|
||||
'retweeted': this.status.repeated
|
||||
'retweeted': this.status.repeated,
|
||||
'animate-spin': this.animated
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue