add tooltip to fab (#497)
This commit is contained in:
parent
e8c0a76051
commit
1209bf4b80
5 changed files with 68 additions and 30 deletions
|
@ -17,11 +17,25 @@
|
|||
:nudge-top="menuTop ? '5' : '0'"
|
||||
allow-overflow
|
||||
>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn :fab="fab" :small="fab" :color="color" :icon="!fab" dark v-bind="attrs" v-on="on" @click.prevent>
|
||||
<template v-slot:activator="{ on: onMenu, attrs: attrsMenu }">
|
||||
<v-tooltip bottom dark :color="color">
|
||||
<template v-slot:activator="{ on: onTooltip, attrs: attrsTooltip }">
|
||||
<v-btn
|
||||
:fab="fab"
|
||||
:small="fab"
|
||||
:color="color"
|
||||
:icon="!fab"
|
||||
dark
|
||||
v-bind="{ ...attrsMenu, ...attrsTooltip }"
|
||||
v-on="{ ...onMenu, ...onTooltip }"
|
||||
@click.prevent
|
||||
>
|
||||
<v-icon>{{ menuIcon }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t("general.more") }}</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<v-list dense>
|
||||
<v-list-item
|
||||
v-for="(item, index) in loggedIn && cardMenu ? userMenu : defaultMenu"
|
||||
|
@ -142,7 +156,7 @@ export default {
|
|||
url: this.recipeURL,
|
||||
})
|
||||
.then(() => console.log("Successful share"))
|
||||
.catch((error) => {
|
||||
.catch(error => {
|
||||
console.log("WebShareAPI not supported", error);
|
||||
this.updateClipboard();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<template>
|
||||
<v-tooltip right :color="buttonStyle ? 'primary' : 'secondary'">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
@click.prevent="toggleFavorite"
|
||||
|
@ -6,11 +8,16 @@
|
|||
:color="buttonStyle ? 'primary' : 'secondary'"
|
||||
:icon="!buttonStyle"
|
||||
:fab="buttonStyle"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon :small="!buttonStyle" color="secondary">
|
||||
{{ isFavorite ? "mdi-heart" : "mdi-heart-outline" }}
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ isFavorite ? $t("recipe.remove-from-favorites") : $t("recipe.add-to-favorites") }}</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -18,9 +18,14 @@
|
|||
/>
|
||||
<v-spacer></v-spacer>
|
||||
<div v-if="!value" class="custom-btn-group ma-1">
|
||||
<v-btn fab small class="mx-1" color="info" @click="$emit('input', true)">
|
||||
<v-tooltip bottom color="info">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn fab small class="mx-1" color="info" v-bind="attrs" v-on="on" @click="$emit('input', true)">
|
||||
<v-icon> {{ $globals.icons.edit }} </v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t("general.edit") }}</span>
|
||||
</v-tooltip>
|
||||
<ContextMenu
|
||||
:menu-top="false"
|
||||
:slug="slug"
|
||||
|
|
|
@ -90,12 +90,22 @@
|
|||
<v-icon> {{ $globals.icons.createAlt }} </v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-btn fab dark small color="primary" @click="addRecipe = true">
|
||||
<v-tooltip left dark color="primary">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn fab dark small color="primary" v-bind="attrs" v-on="on" @click="addRecipe = true">
|
||||
<v-icon>mdi-link</v-icon>
|
||||
</v-btn>
|
||||
<v-btn fab dark small color="accent" @click="$router.push('/new')">
|
||||
</template>
|
||||
<span>{{ $t("new-recipe.from-url") }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip left dark color="accent">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn fab dark small color="accent" v-bind="attrs" v-on="on" @click="$router.push('/new')">
|
||||
<v-icon>{{ $globals.icons.edit }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t("general.new") }}</span>
|
||||
</v-tooltip>
|
||||
</v-speed-dial>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -160,8 +170,7 @@ export default {
|
|||
this.processing = false;
|
||||
},
|
||||
isValidWebUrl(url) {
|
||||
let regEx =
|
||||
/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,256}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/gm;
|
||||
let regEx = /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,256}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/gm;
|
||||
return regEx.test(url) ? true : "Must be a Valid URL";
|
||||
},
|
||||
|
||||
|
|
|
@ -117,7 +117,8 @@
|
|||
"url": "URL",
|
||||
"view": "View",
|
||||
"wednesday": "Wednesday",
|
||||
"yes": "Yes"
|
||||
"yes": "Yes",
|
||||
"more": "More"
|
||||
},
|
||||
"group": {
|
||||
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
|
||||
|
@ -251,7 +252,9 @@
|
|||
"title": "Title",
|
||||
"total-time": "Total Time",
|
||||
"unable-to-delete-recipe": "Unable to Delete Recipe",
|
||||
"view-recipe": "View Recipe"
|
||||
"view-recipe": "View Recipe",
|
||||
"add-to-favorites": "Add to Favorites",
|
||||
"remove-from-favorites": "Remove from Favorites"
|
||||
},
|
||||
"search": {
|
||||
"and": "and",
|
||||
|
|
Loading…
Reference in a new issue