duplicate ingredient to correct location
This commit is contained in:
@ -577,7 +577,7 @@
|
|||||||
{{ $t("Copy_template_reference") }}
|
{{ $t("Copy_template_reference") }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="dropdown-item"
|
<button type="button" class="dropdown-item"
|
||||||
@click="duplicateIngredient(step, ingredient)">
|
@click="duplicateIngredient(step, ingredient, index + 1)">
|
||||||
<i class="fas fa-copy"></i>
|
<i class="fas fa-copy"></i>
|
||||||
{{ $t("Copy") }}
|
{{ $t("Copy") }}
|
||||||
</button>
|
</button>
|
||||||
@ -1234,9 +1234,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
duplicateIngredient: function (step, ingredient) {
|
duplicateIngredient: function (step, ingredient, new_index) {
|
||||||
delete ingredient.id
|
delete ingredient.id
|
||||||
step.ingredients.push(ingredient)
|
step.ingredients.splice(new_index < 0 ? 0 : new_index, 0, ingredient)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user