Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$("#sidebarToggle").on('click', function (e) {
let $body = $('body');
e.preventDefault();
if ($($body).is(".sidebar-toggled")) {
Cookies.set('sidebar-toggled', false);
} else {
Cookies.set('sidebar-toggled', true);
}
$("body").toggleClass("sidebar-toggled");
$(".sidebar").toggleClass("toggled");
});
$("#sidebarToggle").on('click', function (e) {
let $body = $('body');
e.preventDefault();
if ($($body).is(".sidebar-toggled")) {
Cookies.set('sidebar-toggled', false);
} else {
Cookies.set('sidebar-toggled', true);
}
$("body").toggleClass("sidebar-toggled");
$(".sidebar").toggleClass("toggled");
});