Pārlūkot izejas kodu

Various fixes to editing recipes.

Lee Morgan 5 gadi atpakaļ
vecāks
revīzija
a7cccffac1

+ 3 - 3
views/dashboardPage/ejs/sidebars/editRecipe.ejs

@@ -13,11 +13,11 @@
         <input id="editRecipeName" type="text">
     </label>
 
-    <label>CATEGORY:
+    <h1 id="editRecipeNoName"></h1>
+    
+    <label style="display:none">CATEGORY:
         <input id="editRecipeCategory" type="text">
     </label>
-    
-    <h1 id="editRecipeNoName"></h1>
 
     <h3>INGREDIENTS</h3>
 

+ 4 - 3
views/dashboardPage/js/sidebars/editRecipe.js

@@ -3,13 +3,14 @@ let editRecipe = {
         let nameInput = document.getElementById("editRecipeName");
         if(merchant.pos === "none"){
             nameInput.value = recipe.name;
+            let categoryInput = document.getElementById("editRecipeCategory");
+            categoryInput.value = recipe.category;
+            categoryInput.parentElement.style.display = "block";
         }else{
-            document.getElementById("editRecipeNoName").innertext = recipe.name;
+            document.getElementById("editRecipeNoName").innerText = recipe.name;
             nameInput.parentNode.style.display = "none";
         }
 
-        document.getElementById("editRecipeCategory").value = recipe.category;
-
         //Populate ingredients
         let ingredientList = document.getElementById("editRecipeIngList");