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.

40 lines
1.7 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. <script type="text/javascript" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
  5. <!-- updated script -->
  6. <!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  7. <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>
  8. <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> -->
  9. <!-- Page JS Plugins -->
  10. <script src="/assets/js/plugins/sweetalert2/sweetalert2.min.js"></script>
  11. <script>
  12. $(document).ready(function() {
  13. // Get the current URL
  14. var currentUrl = window.location.href;
  15. // Loop through each navigation item
  16. $('.nav-main-item').each(function() {
  17. // Get the link for this item
  18. var link = $(this).find('.nav-main-link').attr('href');
  19. //console.log(link + " == " + currentUrl + " == " + currentUrl.indexOf(link));
  20. // Check if the link matches the current URL
  21. if (currentUrl.indexOf(link) !== -1 ) {
  22. // Add the active class to this item
  23. $(this).find('.nav-main-link').addClass('active');
  24. // Add the open class to the parent item
  25. $(this).parents('.nav-main-item').addClass('open');
  26. }
  27. });
  28. });
  29. </script>