Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-06-11 12:15:15 -08:00 committed by GitHub
parent ead02737ab
commit d036cbc962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 20 deletions

View File

@ -18,7 +18,7 @@
allow-overflow allow-overflow
> >
<template v-slot:activator="{ on, attrs }"> <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> <v-btn :fab="fab" :small="fab" :color="color" :icon="!fab" dark v-bind="attrs" v-on="on" @click.prevent>
<v-icon>{{ menuIcon }}</v-icon> <v-icon>{{ menuIcon }}</v-icon>
</v-btn> </v-btn>
</template> </template>

View File

@ -17,17 +17,8 @@
v-on:confirm="emitDelete()" v-on:confirm="emitDelete()"
/> />
<v-spacer></v-spacer> <v-spacer></v-spacer>
<div v-if="!edit" class="custom-btn-group ma-1"> <div v-if="!value" class="custom-btn-group ma-1">
<v-btn <v-btn fab small class="mx-1" color="info" @click="$emit('input', true)">
fab
small
class="mx-1"
color="info"
@click="
edit = true;
$emit('edit');
"
>
<v-icon> {{ $globals.icons.edit }} </v-icon> <v-icon> {{ $globals.icons.edit }} </v-icon>
</v-btn> </v-btn>
<ContextMenu <ContextMenu
@ -40,7 +31,7 @@
:card-menu="false" :card-menu="false"
/> />
</div> </div>
<div v-if="edit" class="custom-btn-group mb-"> <div v-if="value" class="custom-btn-group mb-">
<v-btn <v-btn
v-for="(btn, index) in editorButtons" v-for="(btn, index) in editorButtons"
:key="index" :key="index"
@ -74,6 +65,10 @@ export default {
name: { name: {
type: String, type: String,
}, },
value: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
@ -95,7 +90,7 @@ export default {
text: "Close", text: "Close",
icon: "mdi-close", icon: "mdi-close",
event: CLOSE_EVENT, event: CLOSE_EVENT,
color: undefined, color: "",
}, },
{ {
text: "Save", text: "Save",
@ -111,11 +106,11 @@ export default {
switch (event) { switch (event) {
case CLOSE_EVENT: case CLOSE_EVENT:
this.$emit(CLOSE_EVENT); this.$emit(CLOSE_EVENT);
this.edit = false; this.$emit("input", false);
break; break;
case SAVE_EVENT: case SAVE_EVENT:
this.$emit(SAVE_EVENT); this.$emit(SAVE_EVENT);
this.edit = false; this.$emit("input", false);
break; break;
case JSON_EVENT: case JSON_EVENT:
this.$emit(JSON_EVENT); this.$emit(JSON_EVENT);
@ -129,7 +124,7 @@ export default {
}, },
emitDelete() { emitDelete() {
this.$emit(DELETE_EVENT); this.$emit(DELETE_EVENT);
this.edit = false; this.$emit("input", false);
}, },
}, },
}; };

View File

@ -10,7 +10,7 @@
</v-img> </v-img>
<br v-else /> <br v-else />
<RecipePageActionMenu @json="jsonEditor = true" @edit="jsonEditor = false" @save="createRecipe" /> <RecipePageActionMenu :value="true" @json="jsonEditor = true" @edit="jsonEditor = false" @save="createRecipe" />
<div v-if="jsonEditor"> <div v-if="jsonEditor">
<!-- Probably not the best way, but it works! --> <!-- Probably not the best way, but it works! -->
@ -61,7 +61,8 @@ export default {
categories: [], categories: [],
// dateAdded: "", // dateAdded: "",
notes: [], notes: [],
extras: [], extras: {},
assets: [],
}, },
}; };
}, },

View File

@ -23,6 +23,7 @@
<RecipePageActionMenu <RecipePageActionMenu
:slug="recipeDetails.slug" :slug="recipeDetails.slug"
:name="recipeDetails.name" :name="recipeDetails.name"
v-model="form"
v-if="loggedIn" v-if="loggedIn"
:open="showIcons" :open="showIcons"
@close="form = false" @close="form = false"
@ -48,7 +49,7 @@
<RecipeEditor <RecipeEditor
v-else v-else
v-model="recipeDetails" v-model="recipeDetails"
:class="$vuetify.breakpoint.xs ? 'mt-5' : undefiend" :class="$vuetify.breakpoint.xs ? 'mt-5' : ''"
ref="recipeEditor" ref="recipeEditor"
@upload="getImageFile" @upload="getImageFile"
/> />