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