Fixed edit-only of editableingredientspanel
This commit is contained in:
parent
1903d50e51
commit
d42462a54e
2 changed files with 9 additions and 6 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div>
|
<div :class="{ editing: editing }">
|
||||||
<button v-if="editing" @click="$emit('on-add')">
|
<button v-if="editing" @click="$emit('on-add')">
|
||||||
<img class="icon" :src="require('@/assets/add-cart.svg')" /> <br />
|
<img class="icon" :src="require('@/assets/add-cart.svg')" /> <br />
|
||||||
Add Ingredient
|
Add Ingredient
|
||||||
</button>
|
</button>
|
||||||
<button @click="toggleEditing">
|
<button @click="toggleEditing" v-if="!editOnly">
|
||||||
<span v-if="editing">
|
<span v-if="editing">
|
||||||
<img class="icon" :src="require('@/assets/edit-off.svg')" /> <br />
|
<img class="icon" :src="require('@/assets/edit-off.svg')" /> <br />
|
||||||
Done Editing
|
Done Editing
|
||||||
|
|
@ -50,9 +50,6 @@ ul {
|
||||||
|
|
||||||
li {
|
li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
li > div {
|
li > div {
|
||||||
|
|
@ -62,6 +59,12 @@ li > div {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editing li {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.ingredient-line {
|
.ingredient-line {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<h4>My Requests</h4>
|
<h4>My Requests</h4>
|
||||||
<editable-ingredients-panel @on-add="addIngredient" @on-delete="deleteIngredient" @on-update-ingredient="updateIngredient" :ingredients="mySources" />
|
<editable-ingredients-panel @on-add="addIngredient" @on-delete="deleteIngredient" @on-update-ingredient="updateIngredient" :ingredients="mySources" />
|
||||||
|
|
||||||
<h4>Full shopping list</h4>
|
<h3>Full shopping list</h3>
|
||||||
<ul class="full-shopping-list">
|
<ul class="full-shopping-list">
|
||||||
<li v-for="item in shoppingList" :key="item.id">
|
<li v-for="item in shoppingList" :key="item.id">
|
||||||
<shopping-list-item :product="item.product" :sources="item.sources" />
|
<shopping-list-item :product="item.product" :sources="item.sources" />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue