Просмотр исходного кода

Fix bug in displaying of recipe details for pos users

Lee Morgan 5 лет назад
Родитель
Сommit
f898520cdc
2 измененных файлов с 6 добавлено и 2 удалено
  1. 3 1
      views/dashboardPage/bundle.js
  2. 3 1
      views/dashboardPage/js/recipeDetails.js

+ 3 - 1
views/dashboardPage/bundle.js

@@ -3494,8 +3494,10 @@ module.exports = recipeBook;
 let recipeDetails = {
     display: function(recipe){
         document.getElementById("editRecipeBtn").onclick = ()=>{controller.openSidebar("editRecipe", recipe)};
-        document.getElementById("removeRecipeBtn").onclick = ()=>{this.remove(recipe)};
         document.getElementById("recipeName").innerText = recipe.name;
+        if(merchant.pos === "none"){
+            document.getElementById("removeRecipeBtn").onclick = ()=>{this.remove(recipe)};
+        }
 
         //ingredient list
         let ingredientsDiv = document.getElementById("recipeIngredientList");

+ 3 - 1
views/dashboardPage/js/recipeDetails.js

@@ -1,8 +1,10 @@
 let recipeDetails = {
     display: function(recipe){
         document.getElementById("editRecipeBtn").onclick = ()=>{controller.openSidebar("editRecipe", recipe)};
-        document.getElementById("removeRecipeBtn").onclick = ()=>{this.remove(recipe)};
         document.getElementById("recipeName").innerText = recipe.name;
+        if(merchant.pos === "none"){
+            document.getElementById("removeRecipeBtn").onclick = ()=>{this.remove(recipe)};
+        }
 
         //ingredient list
         let ingredientsDiv = document.getElementById("recipeIngredientList");