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.

32 lines
1018 B

3 years ago
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. <!-- Page JS Plugins -->
  5. <script src="/assets/js/plugins/sweetalert2/sweetalert2.min.js"></script>
  6. <script>
  7. $(document).ready(function() {
  8. // Get the current URL
  9. var currentUrl = window.location.href;
  10. // Loop through each navigation item
  11. $('.nav-main-item').each(function() {
  12. // Get the link for this item
  13. var link = $(this).find('.nav-main-link').attr('href');
  14. //console.log(link + " == " + currentUrl + " == " + currentUrl.indexOf(link));
  15. // Check if the link matches the current URL
  16. if (currentUrl.indexOf(link) !== -1 ) {
  17. // Add the active class to this item
  18. $(this).find('.nav-main-link').addClass('active');
  19. // Add the open class to the parent item
  20. $(this).parents('.nav-main-item').addClass('open');
  21. }
  22. });
  23. });
  24. </script>