Bladeren bron

Bug fixes

Lee Morgan 6 jaren geleden
bovenliggende
commit
ccc0762cfc

+ 3 - 1
views/inventoryPage/addIngredient.js

@@ -1,7 +1,9 @@
-let addIngredientsObj = {
+let addIngredientObj = {
     display: function(){
         controller.clearScreen();
         controller.addIngredientStrand.style.display = "flex";
+
+        this.displayAdd();
     },
     
     //Fixerup

+ 6 - 6
views/inventoryPage/inventory.ejs

@@ -14,17 +14,17 @@
 
             <a href="/recipes">View Recipes</a>
 
-            <button onclick="inventoryPage.displayAdd()">Add Ingredient</button>
+            <button onclick="addIngredientObj.display()">Add Ingredient</button>
 
-            <input id="filter" onkeyup="inventoryPage.filter()" type="text" placeholder="Start typing to filter">
+            <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="Start typing to filter">
 
             <table>
                 <thead>
                     <tr>
-                        <th onclick="inventoryPage.sortIngredients('name')">Item</th>
-                        <th onclick="inventoryPage.sortIngredients('category')">Category</th>
-                        <th onclick="inventoryPage.sortIngredients('quantity')">Quantity</th>
-                        <th onclick="inventoryPage.sortIngredients('unit')">Unit</th>
+                        <th onclick="inventoryObj.sortIngredients('name')">Item</th>
+                        <th onclick="inventoryObj.sortIngredients('category')">Category</th>
+                        <th onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
+                        <th onclick="inventoryObj.sortIngredients('unit')">Unit</th>
                         <th></th>
                     </tr>
                     <tbody></tbody>

+ 1 - 3
views/inventoryPage/inventory.js

@@ -15,8 +15,6 @@ let inventoryObj = {
 
     populateIngredients: function(){
         let tbody = document.querySelector("#inventoryStrand tbody");
-        console.log("something else");
-        console.log(tbody);
 
         while(tbody.children.length > 0){
             tbody.removeChild(tbody.firstChild);
@@ -159,5 +157,5 @@ let inventoryObj = {
                 banner.createError("There was an error and the ingredient has not been removed from your inventory");
                 console.log(err);
             });
-    },   
+    },
 }

+ 1 - 1
views/recipesPage/recipes.ejs

@@ -13,7 +13,7 @@
 
         <div id="recipes">
             <button id="recipeUpdate" onclick="recipesPage.updateRecipes()">Update Recipes</button>
-            <a href="/">Return to Inventory</a>
+            <a href="/inventory">Return to Inventory</a>
 
             <div id="recipesContainer"></div>
         </div>