You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.6 KiB

3 years ago
​
​
​
3 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <script src="/assets/js/dashmix.app.min.js"></script>
  2. <!-- jQuery (required for DataTables plugin) -->
  3. <script src="/assets/js/lib/jquery.min.js"></script>
  4. <!-- bootstrap script -->
  5. <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  6. <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
  7. <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  8. <!-- Page JS Plugins -->
  9. <script src="/assets/js/plugins/sweetalert2/sweetalert2.min.js"></script>
  10. <script>
  11. $(document).ready(function() {
  12. // Get the current URL
  13. var currentUrl = window.location.href;
  14. // Loop through each navigation item
  15. $('.nav-main-item').each(function() {
  16. // Get the link for this item
  17. var link = $(this).find('.nav-main-link').attr('href');
  18. //console.log(link + " == " + currentUrl + " == " + currentUrl.indexOf(link));
  19. // Check if the link matches the current URL
  20. if (currentUrl.indexOf(link) !== -1 ) {
  21. // Add the active class to this item
  22. $(this).find('.nav-main-link').addClass('active');
  23. // Add the open class to the parent item
  24. $(this).parents('.nav-main-item').addClass('open');
  25. }
  26. });
  27. });
  28. </script>