diff options
| author | xj9 <xj9@heropunch.io> | 2017-03-08 21:45:40 -0700 |
|---|---|---|
| committer | xj9 <xj9@heropunch.io> | 2017-03-08 21:45:40 -0700 |
| commit | 459fdaf10fcc55248ec2868963edcba51114c877 (patch) | |
| tree | 89a131c0b0c946e8fa4e50dbc57915aeac5e8442 /src/components/retweet_button/retweet_button.js | |
| parent | ba4f7ef3efe15aaebce523113283b5854d16ceb8 (diff) | |
add a spin animation to favorite and boost actions
Diffstat (limited to 'src/components/retweet_button/retweet_button.js')
| -rw-r--r-- | src/components/retweet_button/retweet_button.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index e7318dc5..2280f315 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -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 } } } |
