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

Create a terrible, but working, modal for the new merchant.

Lee Morgan 5 лет назад
Родитель
Сommit
519afc5083

+ 3 - 0
views/dashboardPage/js/dashboard.js

@@ -228,6 +228,9 @@ controller = {
             case "feedback":
                 modalScript.feedback();
                 break;
+            case "newMerchant":
+                modalScript.newMerchant();
+                break;
         }
     },
 

+ 6 - 0
views/dashboardPage/js/modal.js

@@ -38,6 +38,12 @@ let modal = {
             .finally(()=>{
                 loader.style.display = "none";
             });
+    },
+
+    newMerchant: function(){
+        let form = document.getElementById("modalNewMerchant");
+        form.style.display = "flex";
+        console.log("new merchant");
     }
 };
 

+ 4 - 0
views/dashboardPage/js/strands/account.js

@@ -5,6 +5,10 @@ let account = {
 
         document.getElementById("accountUpdate").onclick = ()=>{this.updateData()};
 
+        //Display alternate locations
+        document.getElementById("settingsAddMerchant").onclick = ()=>{controller.openModal("newMerchant")};
+
+        //Handle the password changey stuffs
         let passButton = document.getElementById("accountShowPassword");
         let passBox = document.getElementById("changePasswordBox");
         passButton.onclick = ()=>{

+ 4 - 0
views/dashboardPage/modal.ejs

@@ -26,6 +26,10 @@
 
                 <input class="button" type="submit" value="SUBMIT">
             </form>
+
+            <form id="modalNewMerchant" style="display:none;" method="post" action="">
+                <h2>NEW MERCHANT</h2>
+            </form>
         </div>
     </div>
 </div>