2016-11-14 02:42:56 +11:00
|
|
|
const RetweetButton = {
|
2017-03-09 15:45:40 +11:00
|
|
|
props: ['status'],
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
animated: false
|
|
|
|
}
|
|
|
|
},
|
2016-11-14 02:42:56 +11:00
|
|
|
methods: {
|
|
|
|
retweet () {
|
2016-11-14 03:09:16 +11:00
|
|
|
if (!this.status.repeated) {
|
|
|
|
this.$store.dispatch('retweet', {id: this.status.id})
|
|
|
|
}
|
2017-03-09 15:45:40 +11:00
|
|
|
this.animated = true
|
|
|
|
setTimeout(() => {
|
|
|
|
this.animated = false
|
|
|
|
}, 500)
|
2016-11-14 02:42:56 +11:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
classes () {
|
|
|
|
return {
|
2017-03-09 15:45:40 +11:00
|
|
|
'retweeted': this.status.repeated,
|
|
|
|
'animate-spin': this.animated
|
2016-11-14 02:42:56 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default RetweetButton
|