Procházet zdrojové kódy

Fix all bugs on information page

Lee Morgan před 6 roky
rodič
revize
ec5df219f8

+ 5 - 1
views/informationPage/help.js

@@ -1,6 +1,10 @@
 window.helpObj = {
     display: function(){
-        clearScreen();
+        document.querySelector("#legalStrand").style.display = "none";
         document.querySelector("#helpStrand").style.display = "flex";
+
+        let button = document.getElementById("logInButton");
+        button.innerText="LEGAL";
+        button.onclick = ()=>{legalObj.display()};
     }
 }

+ 0 - 1
views/informationPage/information.ejs

@@ -492,6 +492,5 @@
         
         <script src="/informationPage/help.js"></script>
         <script src="/informationPage/legal.js"></script>
-        <script src="/shared/controller.js"></script>
     </body>
 </html>

+ 9 - 2
views/informationPage/legal.js

@@ -1,6 +1,13 @@
 window.legalObj = {
     display: function(){
-        clearScreen();
         document.querySelector("#legalStrand").style.display = "flex";
+        document.querySelector("#helpStrand").style.display = "none";
+
+        document.getElementById("joinButton").style.display = "none";
+        let button = document.getElementById("logInButton");
+        button.innerText="HELP";
+        button.onclick = ()=>{helpObj.display()};
     }
-}
+}
+
+legalObj.display();

+ 6 - 10
views/shared/header.ejs

@@ -3,14 +3,10 @@
         <img src="/shared/images/logo.png" alt="Subline">
         <div class='header-logo'> SUBLINE </div>
     </a>
-    
-    <% if(locals.merchant || locals.data){ %>
-        <a class="logout" href="/logout">Log out</a>
-    <% }else{ %>
-        <div class="public-buttons">
-            <button class="button" onclick="loginObj.display()"> Log In </button>
-    
-            <a class="button-join link" onclick="registerObj.display()"> Or Join </a>
-        </div>
-    <% } %>
+
+    <div class="public-buttons">
+        <button id="logInButton" class="button" onclick="loginObj.display()"> Log In </button>
+
+        <a id="joinButton" class="button-join link" onclick="registerObj.display()"> Or Join </a>
+    </div>
 </div>