diff --git a/src/components/DatePicker.vue b/src/components/DatePicker.vue
index d9e949c..341515b 100644
--- a/src/components/DatePicker.vue
+++ b/src/components/DatePicker.vue
@@ -12,8 +12,7 @@
+ @mousedown="selectDate(day)">
{{ formatDay(day) }}
diff --git a/src/components/EditMealPage.vue b/src/components/EditMealPage.vue
index 0ef879f..92cf07f 100644
--- a/src/components/EditMealPage.vue
+++ b/src/components/EditMealPage.vue
@@ -21,11 +21,11 @@
-
Ingredients
+
Additional Ingredients
-
-
+
@@ -44,11 +44,11 @@ import RecipeSearchBox from './RecipeSearchBox.vue';
import RecipeCard from './RecipeCard.vue';
import DatePicker from './DatePicker.vue';
import IngredientAddBox from './IngredientAddBox.vue';
-import IngredientLine from './IngredientLine.vue';
+import CompactParsedIngredient from './CompactParsedIngredient.vue';
export default {
props: ['id'],
- components: { RecipeSearchBox, DatePicker, RecipeCard, IngredientAddBox, IngredientLine },
+ components: { RecipeSearchBox, DatePicker, RecipeCard, IngredientAddBox, CompactParsedIngredient },
data() {
return {
meal: {
@@ -70,6 +70,7 @@ export default {
this.meal.recipes.push(recipe);
},
selectDate(date) {
+ console.log("selectDate", date);
this.meal.date = date;
},
removeRecipe(recipe) {
diff --git a/src/components/IngredientAddBox.vue b/src/components/IngredientAddBox.vue
index 09a1fd3..8f613c2 100644
--- a/src/components/IngredientAddBox.vue
+++ b/src/components/IngredientAddBox.vue
@@ -24,6 +24,7 @@ export default {
name: '',
quantity: '',
unit: '',
+ link: ''
},
}
},
@@ -39,20 +40,13 @@ export default {
},
updateProduct(ingredient, product_link) {
data.parseProduct(ingredient, product_link).then(product => {
- ingredient.product = product
+ this.ingredient.product = product;
+ this.ingredient.product_link = product.link;
});
},
updateIngredient(ingredient, line) {
- data.parseIngredients([line]).then(function(newIngredients) {
- const newIngredient = newIngredients[0];
- ingredient.line = line;
- ingredient.name = newIngredient.name;
- ingredient.quantity = newIngredient.quantity;
- ingredient.unit = newIngredient.unit;
- ingredient.preparation = newIngredient.preparation;
- if (newIngredient.product) {
- ingredient.product = newIngredient.product;
- }
+ data.parseIngredients([line]).then(newIngredients => {
+ this.ingredient = newIngredients[0];
});
},
}
diff --git a/src/components/IngredientLine.vue b/src/components/IngredientLine.vue
index 1c8a6e8..4604c36 100644
--- a/src/components/IngredientLine.vue
+++ b/src/components/IngredientLine.vue
@@ -1,5 +1,11 @@
+
@@ -15,12 +21,6 @@
-
Ingredient: {{ ingredient.name }}