remove duplicate insert-ingredient and fix above/below in parser

This commit is contained in:
Michael Genson 2025-07-28 19:00:24 +00:00
commit bf3127ed61
2 changed files with 2 additions and 14 deletions

View file

@ -153,7 +153,6 @@
@toggle-original="toggleOriginalText"
@insert-above="$emit('insert-above')"
@insert-below="$emit('insert-below')"
@insert-ingredient="$emit('insert-ingredient')"
@delete="$emit('delete')"
/>
</div>
@ -189,17 +188,12 @@ const props = defineProps({
type: Boolean,
default: false,
},
allowInsertIngredient: {
type: Boolean,
default: false,
},
});
defineEmits([
"clickIngredientField",
"insert-above",
"insert-below",
"insert-ingredient",
"delete",
]);
@ -228,13 +222,6 @@ const contextMenuOptions = computed(() => {
},
];
if (props.allowInsertIngredient) {
options.push({
text: i18n.t("recipe.insert-ingredient"),
event: "insert-ingredient",
});
}
if (model.value.originalText) {
options.push({
text: i18n.t("recipe.see-original-text"),

View file

@ -103,7 +103,8 @@
<RecipeIngredientEditor
v-model="parsedIng[index].ingredient"
allow-insert-ingredient
@insert-ingredient="insertIngredient(index)"
@insert-above="insertIngredient(index)"
@insert-below="insertIngredient(index + 1)"
@delete="deleteIngredient(index)"
/>
{{ ing.input }}