mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Adjust sidebar toggle behavior on >768 displays
This commit is contained in:
parent
7b02c1fa72
commit
e054a963f6
@ -269,19 +269,23 @@ $("#sidebarToggleTopbar").on('click', function(e) {
|
|||||||
$("#sidebarToggle, #sidebarToggleTop").on('click', function(e) {
|
$("#sidebarToggle, #sidebarToggleTop").on('click', function(e) {
|
||||||
var toggled = $(".sidebar").hasClass("toggled");
|
var toggled = $(".sidebar").hasClass("toggled");
|
||||||
// Persist state in cookie
|
// Persist state in cookie
|
||||||
setCookie('sidebar',toggled, 90);
|
setCookie('sidebarToggled',toggled, 90);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
if ($(window).width() < 768) {
|
if ($(window).width() < 768) {
|
||||||
$('.sidebar').addClass('toggled');
|
$('.sidebar').addClass('toggled');
|
||||||
|
setCookie('sidebarToggled',false, 90);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on("load resize",function(e) {
|
$(window).on("load resize",function(e) {
|
||||||
if ($(window).width() > 768) {
|
if ($(window).width() > 768) {
|
||||||
$('.sidebar').removeClass('d-none d-md-block');
|
$('.sidebar').removeClass('d-none d-md-block');
|
||||||
};
|
if (getCookie('sidebarToggled') == 'false') {
|
||||||
|
$('.sidebar').removeClass('toggled');
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Adds active class to current nav-item
|
// Adds active class to current nav-item
|
||||||
|
Loading…
Reference in New Issue
Block a user