diff --git a/index.html b/index.html index ed3b8fb..719e46d 100644 --- a/index.html +++ b/index.html @@ -44,20 +44,15 @@
Drink Options
- - - - - @@ -247,7 +242,7 @@ - + @@ -263,13 +258,40 @@ + +
diff --git a/js/createDrink.js b/js/createDrink.js index 740072f..fe942ac 100644 --- a/js/createDrink.js +++ b/js/createDrink.js @@ -322,6 +322,23 @@ function addSyrup(recipe, syrup, size, qunatity){ return recipe; } +function addOther(recipe, other, size, quantity){ + let o = {}; + o.name = other; + if(quantity){ + o.count = quantity; + } + + let otherOthers = _.without(recipe.addedOthers, _.findWhere(recipe.addedOthers, { + name: other + })); + + otherOthers.push(o); + recipe.addedOthers = otherOthers; + + return recipe; +} + function standardPumps(size, mod){ let modValue; if(!mod)