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

View file

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