|
@@ -1484,6 +1484,29 @@ controller = {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ openModal: function(str){
|
|
|
|
|
+ let modal = document.getElementById("modal");
|
|
|
|
|
+ document.getElementById("modalClose").addEventListener("click", this.closeModal);
|
|
|
|
|
+
|
|
|
|
|
+ switch(str){
|
|
|
|
|
+ case "recipeSpreadsheet":
|
|
|
|
|
+ modal.style.display = "flex";
|
|
|
|
|
+ document.getElementById("modalSpreadsheetUpload").style.display = "flex";
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ closeModal: function(){
|
|
|
|
|
+ let modal = document.getElementById("modal");
|
|
|
|
|
+ let modalContent = document.getElementById("modalContent");
|
|
|
|
|
+
|
|
|
|
|
+ for(let i = 0; i < modalContent.children.length; i++){
|
|
|
|
|
+ modalContent.children[i].style.display = "none";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ modal.style.display = "none";
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
changeMenu: function(){
|
|
changeMenu: function(){
|
|
|
let menu = document.querySelector(".menu");
|
|
let menu = document.querySelector(".menu");
|
|
|
let buttons = document.querySelectorAll(".menuButton");
|
|
let buttons = document.querySelectorAll(".menuButton");
|
|
@@ -2226,6 +2249,7 @@ let newRecipe = {
|
|
|
|
|
|
|
|
document.getElementById("ingredientCount").onchange = ()=>{this.changeIngredientCount(categories)};
|
|
document.getElementById("ingredientCount").onchange = ()=>{this.changeIngredientCount(categories)};
|
|
|
document.getElementById("submitNewRecipe").onclick = ()=>{this.submit(Recipe)};
|
|
document.getElementById("submitNewRecipe").onclick = ()=>{this.submit(Recipe)};
|
|
|
|
|
+ document.getElementById("recipeFileUpload").onclick = ()=>{controller.openModal("recipeSpreadsheet")};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//Updates the number of ingredient inputs displayed for new recipes
|
|
//Updates the number of ingredient inputs displayed for new recipes
|