Skip to content

Commit d387153

Browse files
committed
ajout de l'impossibilité d'avoir plusieurs tags appareils selectionnés
1 parent 0d85338 commit d387153

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

js/containers/tagsContainer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ class TagsContainer {
66
if (this.activeTags[i].name == name) {
77
return;
88
}
9+
10+
if (this.activeTags[i].type == 3 && type == 3) {
11+
this.activeTags[i].getTagDOM().remove();
12+
this.activeTags.splice(i, 1);
13+
}
914
}
1015

1116
let tagModel = new TagManager({ name, type });

js/utils/searchUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function searchRecipesByIngredientsTags(tags, dataset) {
1919
let recipeCheckSucceed = true;
2020
let recipeIngredients = [];
2121
console.log(recipe);
22+
2223
for (ingredient of recipe.ingredients) {
2324
console.log(ingredient.ingredient);
2425
recipeIngredients.push(ingredient.ingredient.toLowerCase());

0 commit comments

Comments
 (0)