|
460 | 460 | <a href="#" onclick="showSection('unresolvedTickets')">Unresolved Tickets</a>
|
461 | 461 | <a href="#" onclick="showSection('remainingExtraAmount')">Remaining & Extra Amounts</a>
|
462 | 462 | <a href="mailto:yehiarasheed@gmail.com"> Support</a>
|
463 |
| - <a href="login.aspx" onclick="logout()">Log Out</a> |
| 463 | + <a href="/Customer/Pages/login.aspx" class="back-button" onclick="clearDarkModeState(); logout();">Log Out</a> |
464 | 464 |
|
465 | 465 | </div>
|
466 | 466 | <!-- Dark Mode Toggle Button -->
|
|
664 | 664 | function toggleDarkMode() {
|
665 | 665 | const body = document.body;
|
666 | 666 | body.classList.toggle('dark-mode');
|
667 |
| - body.classList.toggle('light-mode'); |
668 | 667 |
|
669 | 668 | // Change the mode icon
|
670 | 669 | const icon = document.getElementById('modeIcon');
|
671 | 670 | if (body.classList.contains('dark-mode')) {
|
672 | 671 | icon.src = "https://img.icons8.com/?size=100&id=83221&format=png&color=FAB005"; // Sun for light mode
|
673 |
| - localStorage.setItem('darkMode', 'true'); // Save dark mode state |
| 672 | + sessionStorage.setItem('darkMode', 'true'); // Save dark mode state |
674 | 673 | } else {
|
675 | 674 | icon.src = "https://img.icons8.com/?size=100&id=59841&format=png&color=FFFFFF"; // Half Moon for dark mode
|
676 |
| - localStorage.removeItem('darkMode'); // Remove dark mode state |
| 675 | + sessionStorage.removeItem('darkMode'); // Remove dark mode state |
677 | 676 | }
|
678 | 677 | }
|
679 | 678 |
|
680 | 679 | document.addEventListener("DOMContentLoaded", function () {
|
681 |
| - // Check if dark mode is enabled in localStorage |
682 |
| - if (localStorage.getItem("darkMode") === "true") { |
| 680 | + // Check if dark mode is enabled in sessionStorage |
| 681 | + if (sessionStorage.getItem("darkMode") === "true") { |
683 | 682 | document.body.classList.add("dark-mode");
|
684 | 683 | document.body.classList.remove("light-mode");
|
685 | 684 | document.getElementById('modeIcon').src = "https://img.icons8.com/?size=100&id=83221&format=png&color=FAB005"; // Sun for light mode
|
|
689 | 688 | document.getElementById('modeIcon').src = "https://img.icons8.com/?size=100&id=59841&format=png&color=FFFFFF"; // Half Moon for dark mode
|
690 | 689 | }
|
691 | 690 | });
|
| 691 | +
|
| 692 | + // Function to clear dark-mode state |
| 693 | + function clearDarkModeState() { |
| 694 | + sessionStorage.removeItem('darkMode'); |
| 695 | + } |
| 696 | +
|
| 697 | + window.addEventListener('load', function () { |
| 698 | + if (sessionStorage.getItem('darkMode') === 'enabled') { |
| 699 | + document.body.classList.add('dark-mode'); |
| 700 | + } |
| 701 | + }); |
| 702 | +
|
692 | 703 | // Sortable Table Functionality
|
693 | 704 | document.addEventListener('DOMContentLoaded', function () {
|
694 | 705 | document.querySelectorAll('.styled-table th').forEach(function (th) {
|
|
726 | 737 |
|
727 | 738 | function logout() {
|
728 | 739 | // Clear the active section
|
729 |
| - localStorage.removeItem('activeSection'); |
730 |
| -
|
731 |
| - // Proceed with your existing logout logic |
732 |
| - // Example: Redirect to login page |
733 |
| - window.location.href = 'login.aspx'; |
| 740 | + sessionStorage.removeItem('activeSection'); |
734 | 741 | }
|
735 | 742 |
|
736 | 743 | // Function to show the pop-up
|
|
0 commit comments