I used Admin LTE theme with Laravel and stucked at one known issue, there is no solution of that in Admin LTE theme, IF I toggle side bar its showing miniside bar, but when i navigate to another page the toggled sidebar again opened, It should not open because i already minimized it,
Please help,
Now you need to add the class sidebar-collapse when you navigate to another page.
Trigger the sidebar-toggle and add a variable to localstorage which will have TRUE as its value.
Now when you navigate to another page, fetch the localstorage variable value and add the class to body by checking localstorage variable.
Ex :
$('.sidebar-toggle').on('click',function(){
var cls = $('body').hasClass('sidebar-collapse');
if(cls == true){
localStorage.setItem('collapse',0);
} else {
localStorage.setItem('collapse',1);
}
});
window.onload = function() {
var collapse = localStorage.getItem('collapse');
if(collapse == true){
$('body').addClass('sidebar-collapse');
} else if(collapse == false) {
$('body').removeClass('sidebar-collapse');
}
}
I hope this will help you.