Skip to content

Commit 2e82ab9

Browse files
author
DanielŻuławski
committed
admin - local storage value for hamburger menu
1 parent 0839a70 commit 2e82ab9

File tree

1 file changed

+14
-1
lines changed
  • src/Web/Grand.Web.Admin/wwwroot/administration/build/js

1 file changed

+14
-1
lines changed

src/Web/Grand.Web.Admin/wwwroot/administration/build/js/custom.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,22 @@ var randNum = function () {
265265
return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
266266
};
267267

268-
function sidebarToggle(el) {
268+
$(document).ready(function () {
269+
if (localStorage.getItem('adminContainerWide') == 'true') {
270+
$(".container.body").addClass("wide");
271+
}
272+
});
273+
function sidebarToggle() {
269274
var container = $(".container.body");
270275
container.toggleClass("wide");
276+
saveContainer(container);
277+
}
278+
function saveContainer(container) {
279+
if (container.hasClass("wide")) {
280+
localStorage.setItem('adminContainerWide', 'true');
281+
} else {
282+
localStorage.setItem('adminContainerWide', 'false');
283+
}
271284
}
272285

273286
// Panel toolbox

0 commit comments

Comments
 (0)