aboutsummaryrefslogtreecommitdiff
path: root/src/components/favorite_button/favorite_button.vue
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-11-24 12:32:42 +0200
committerShpuld Shpuldson <shp@cock.li>2020-11-24 12:32:42 +0200
commit7b99d98c553f40ec4d633d0d4fdf65f275c80e77 (patch)
treeb856ab6b3682b0f1df44511d142d99ae98310416 /src/components/favorite_button/favorite_button.vue
parent14ce0c1c073e17060a7d3cbe4352a5e9881c03dd (diff)
Replace all use of <a> + href='#' with proper buttons
Diffstat (limited to 'src/components/favorite_button/favorite_button.vue')
-rw-r--r--src/components/favorite_button/favorite_button.vue38
1 files changed, 19 insertions, 19 deletions
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>