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.
 
 
 
 

41 lines
1.7 KiB

<script src="/assets/js/dashmix.app.min.js"></script>
<!-- jQuery (required for DataTables plugin) -->
<script src="/assets/js/lib/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<!-- updated script -->
<!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<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>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> -->
<!-- Page JS Plugins -->
<script src="/assets/js/plugins/sweetalert2/sweetalert2.min.js"></script>
<script>
$(document).ready(function() {
// Get the current URL
var currentUrl = window.location.href;
// Loop through each navigation item
$('.nav-main-item').each(function() {
// Get the link for this item
var link = $(this).find('.nav-main-link').attr('href');
//console.log(link + " == " + currentUrl + " == " + currentUrl.indexOf(link));
// Check if the link matches the current URL
if (currentUrl.indexOf(link) !== -1 ) {
// Add the active class to this item
$(this).find('.nav-main-link').addClass('active');
// Add the open class to the parent item
$(this).parents('.nav-main-item').addClass('open');
}
});
});
</script>