fix recipe scale tooltip showing also on other parts of the component

This commit is contained in:
Kuchenpirat 2025-06-02 16:12:43 +00:00
commit 0c6046f829
2 changed files with 34 additions and 15 deletions

View file

@ -1,21 +1,11 @@
<template> <template>
<div class="d-flex justify-space-between align-center pt-2 pb-3"> <div class="d-flex justify-space-between align-center pt-2 pb-3">
<v-tooltip <RecipeScaleEditButton
v-if="!isEditMode" v-if="!isEditMode"
size="small" v-model.number="scaleValue"
top :recipe-servings="recipeServings"
color="secondary-darken-1" :edit-scale="!recipe.settings.disableAmount && !isEditMode"
> />
<template #activator="{ props }">
<RecipeScaleEditButton
v-model.number="scaleValue"
v-bind="props"
:recipe-servings="recipeServings"
:edit-scale="!recipe.settings.disableAmount && !isEditMode"
/>
</template>
<span> {{ $t("recipe.edit-scale") }} </span>
</v-tooltip>
</div> </div>
</template> </template>

View file

@ -11,7 +11,36 @@
:close-on-content-click="false" :close-on-content-click="false"
> >
<template #activator="{ props }"> <template #activator="{ props }">
<v-tooltip
v-if="canEditScale"
size="small"
top
color="secondary-darken-1"
>
<template #activator="{ props: tooltipProps }">
<v-card
class="pa-1 px-2"
dark
color="secondary-darken-1"
size="small"
v-bind="{ ...props, ...tooltipProps }"
:style="{ cursor: canEditScale ? '' : 'default' }"
>
<v-icon
v-if="canEditScale"
size="small"
class="mr-2"
>
{{ $globals.icons.edit }}
</v-icon>
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="yieldDisplay" />
</v-card>
</template>
<span> {{ $t("recipe.edit-scale") }} </span>
</v-tooltip>
<v-card <v-card
v-else
class="pa-1 px-2" class="pa-1 px-2"
dark dark
color="secondary-darken-1" color="secondary-darken-1"