Book form: can now click "start read" even when the book is marked as read
It will do the same behavior as clicking on the "read" button again to cancel it.
This commit is contained in:
@@ -5,16 +5,13 @@ const props = defineProps({
|
||||
icon: String,
|
||||
legend: String,
|
||||
isSet: Boolean,
|
||||
isReadonly: Boolean,
|
||||
})
|
||||
|
||||
const hovered = ref(false)
|
||||
const isOnMobile = ref(computeIsOnMobile())
|
||||
|
||||
const computedIcon = computed(
|
||||
() =>
|
||||
props.icon +
|
||||
(!props.isReadonly && ((hovered.value && !isOnMobile.value) || props.isSet) ? 'Fill' : ''),
|
||||
() => props.icon + ((hovered.value && !isOnMobile.value) || props.isSet ? 'Fill' : ''),
|
||||
)
|
||||
|
||||
function computeIsOnMobile() {
|
||||
@@ -34,8 +31,7 @@ onUnmounted(() => {
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="bigiconandlegend"
|
||||
:class="props.isReadonly ? 'widget-readonly' : 'showcanclick'"
|
||||
class="bigiconandlegend showcanclick"
|
||||
@mouseover="hovered = true"
|
||||
@mouseout="hovered = false"
|
||||
>
|
||||
@@ -79,10 +75,6 @@ onUnmounted(() => {
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.widget-readonly {
|
||||
opacity: 50%;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.bigicon {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user