refactor: seperated addedSyrups from standard

This commit is contained in:
Joshua Shoemaker 2017-01-30 21:43:49 -06:00
parent 2e713ee078
commit 968a79335c
2 changed files with 6 additions and 5 deletions

View File

@ -8,8 +8,9 @@ function createDrink(){
assigned: false,
shotType: shotTypes.NORMAL,
syrups: [],
addedSyrups: [],
milk: milkTypes.NONE
}
},
}
}
@ -139,12 +140,12 @@ function addSyrup(drink, syrup, qunatity){
count: pumps
}
let otherSyrups = _.without(drink.recipe.syrups, _.findWhere(drink.recipe.syrups, {
let otherSyrups = _.without(drink.recipe.addedSyrups, _.findWhere(drink.recipe.addedSyrups, {
name: syrup
}));
otherSyrups.push(s);
drink.recipe.syrups = otherSyrups;
drink.recipe.addedSyrups = otherSyrups;
return drink;
}

View File

@ -80,8 +80,8 @@ function orderDisplay(drink){
o.caffeine = ""
}
if(drink.recipe.syrups.length > 0){
drink.recipe.syrups.forEach(function(e) {
if(drink.recipe.addedSyrups.length > 0){
drink.recipe.addedSyrups.forEach(function(e) {
o.syrups += e.name + "<br>"
}, this);
}