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