aboutsummaryrefslogtreecommitdiff
path: root/src/components/favorite_button/favorite_button.js
diff options
context:
space:
mode:
authorshpuld <shpuld@gmail.com>2017-03-09 12:45:12 +0200
committershpuld <shpuld@gmail.com>2017-03-09 12:45:12 +0200
commitd99b9bdac124b6353adfc9ea0fb52a3b380b91a2 (patch)
tree7a901e3264dffb7fec2a3c051653023bb0eb6ffe /src/components/favorite_button/favorite_button.js
parent507fe7905052e2dc5e9bf3e1ee3caee5239e353b (diff)
parent64d71b75cfed41d82a99e3e478fc75d5f81f84bd (diff)
Merged with changes in develop & fixed conflicts.
Diffstat (limited to 'src/components/favorite_button/favorite_button.js')
-rw-r--r--src/components/favorite_button/favorite_button.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js
index 4ee3890f..466e9b84 100644
--- a/src/components/favorite_button/favorite_button.js
+++ b/src/components/favorite_button/favorite_button.js
@@ -1,5 +1,10 @@
const FavoriteButton = {
- props: [ 'status' ],
+ props: ['status'],
+ data () {
+ return {
+ animated: false
+ }
+ },
methods: {
favorite () {
if (!this.status.favorited) {
@@ -7,13 +12,18 @@ const FavoriteButton = {
} else {
this.$store.dispatch('unfavorite', {id: this.status.id})
}
+ this.animated = true
+ setTimeout(() => {
+ this.animated = false
+ }, 500)
}
},
computed: {
classes () {
return {
'icon-star-empty': !this.status.favorited,
- 'icon-star': this.status.favorited
+ 'icon-star': this.status.favorited,
+ 'animate-spin': this.animated
}
}
}