Parcourir la source

Update the style of the locations in the settings.

Lee Morgan il y a 5 ans
Parent
commit
e34a77604b

+ 1 - 1
controllers/renderer.js

@@ -45,7 +45,7 @@ module.exports = {
                 let transactions = Transaction.aggregate([
                     {$match: {
                         merchant: new ObjectId(merchant._id),
-                        date: {$gte: firstDay},
+                        date: {$gte: firstDay}
                     }},
                     {$sort: {date: -1}},
                     {$project: {

+ 3 - 17
views/dashboardPage/dashboard.css

@@ -614,25 +614,11 @@ ACCOUNT STRAND
     }
 
     #settingsMerchants{
-        width: 85%;
+        display: flex;
+        flex-direction: column;
+        width: 50%;
     }
 
-        .locationDiv{
-            width: 100%;
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            padding: 0 25px;
-            background: rgb(179, 191, 209);
-            box-shadow: 1px 1px 1px black;
-            margin: 10px 0;
-        }
-
-            .locationDiv p{
-                font-size: 25px;
-                font-weight: bold;
-            }
-
     #accountShowPassword{
         max-width: 300px;
     }

+ 0 - 8
views/dashboardPage/ejs/strands/account.ejs

@@ -75,13 +75,5 @@
                 <p>* This will log you out of all current sessions</p>
             </div>
         </div>
-
-        <template id="locationDiv">
-            <div class="locationDiv">
-                <p></p>
-
-                <button class="button">USE</button>
-            </div>
-        </template>
     </div>
 </div>

+ 5 - 5
views/dashboardPage/js/strands/account.js

@@ -11,17 +11,17 @@ let account = {
         //Display alternate locations
         document.getElementById("settingsAddMerchant").onclick = ()=>{controller.openModal("newMerchant")};
         let container = document.getElementById("settingsMerchants");
-        let template = document.getElementById("locationDiv").content.children[0];
 
         while(container.children.length > 0){
             container.removeChild(container.firstChild);
         }
 
         for(let i = 0; i < merchant.owner.merchants.length; i++){
-            let div = template.cloneNode(true);
-            div.children[0].innerText = merchant.owner.merchants[i].name;
-            div.children[1].onclick = ()=>{this.switchMerchant(merchant.owner.merchants[i]._id)};
-            container.appendChild(div);
+            let button = document.createElement("button");
+            button.innerText = merchant.owner.merchants[i].name;
+            button.classList.add("button");
+            button.onclick = ()=>{this.switchMerchant(merchant.owner.merchants[i]._id)};
+            container.appendChild(button);
         }
 
         //Handle the password changey stuffs