diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-11-24 12:32:42 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-11-24 12:32:42 +0200 |
| commit | 7b99d98c553f40ec4d633d0d4fdf65f275c80e77 (patch) | |
| tree | b856ab6b3682b0f1df44511d142d99ae98310416 /src/components/favorite_button | |
| parent | 14ce0c1c073e17060a7d3cbe4352a5e9881c03dd (diff) | |
Replace all use of <a> + href='#' with proper buttons
Diffstat (limited to 'src/components/favorite_button')
| -rw-r--r-- | src/components/favorite_button/favorite_button.js | 5 | ||||
| -rw-r--r-- | src/components/favorite_button/favorite_button.vue | 38 |
2 files changed, 19 insertions, 24 deletions
diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index 2a2ee84a..5cd05f73 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -31,11 +31,6 @@ const FavoriteButton = { } }, computed: { - classes () { - return { - '-favorited': this.status.favorited - } - }, ...mapGetters(['mergedConfig']) } } diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index dfe12f86..d54ae78c 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -1,18 +1,20 @@ <template> - <div v-if="loggedIn"> - <FAIcon - :class="classes" - class="FavoriteButton fa-scale-110 fa-old-padding -interactive" + <div> + <button + v-if="loggedIn" + class="FavoriteButton -interactive button-unstyled -padded" + :class="status.favorited && '-favorited'" :title="$t('tool_tip.favorite')" - :icon="[status.favorited ? 'fas' : 'far', 'star']" - :spin="animated" @click.prevent="favorite()" - /> - <span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span> - </div> - <div v-else> + > + <FAIcon + class="fa-scale-110 fa-old-padding" + :icon="[status.favorited ? 'fas' : 'far', 'star']" + :spin="animated" + /> + </button> <FAIcon - :class="classes" + v-else class="FavoriteButton fa-scale-110 fa-old-padding" :title="$t('tool_tip.favorite')" :icon="['far', 'star']" @@ -28,18 +30,16 @@ .FavoriteButton { &.-interactive { - cursor: pointer; - animation-duration: 0.6s; - &:hover { + .svg-inline--fa { + animation-duration: 0.6s; + } + + &:hover .svg-inline--fa, + &.-favorited .svg-inline--fa { color: $fallback--cOrange; color: var(--cOrange, $fallback--cOrange); } } - - &.-favorited { - color: $fallback--cOrange; - color: var(--cOrange, $fallback--cOrange); - } } </style> |
