From 70a714287706fbde3f2043315f939a8e98e2d9c4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 16 May 2019 11:15:49 +1000 Subject: [PATCH] Fix for sidebar collapse/expand and window resizing --- .../adminlte/views/layouts/app.blade.php | 2 +- .../views/layouts/partials/scripts.blade.php | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/resources/themes/adminlte/views/layouts/app.blade.php b/resources/themes/adminlte/views/layouts/app.blade.php index e97a6e5..caa4a35 100644 --- a/resources/themes/adminlte/views/layouts/app.blade.php +++ b/resources/themes/adminlte/views/layouts/app.blade.php @@ -4,7 +4,7 @@ @include('adminlte::layouts.partials.htmlheader') @show - +
@include('adminlte::layouts.partials.mainheader') diff --git a/resources/themes/adminlte/views/layouts/partials/scripts.blade.php b/resources/themes/adminlte/views/layouts/partials/scripts.blade.php index 360c1e6..5f5ae94 100644 --- a/resources/themes/adminlte/views/layouts/partials/scripts.blade.php +++ b/resources/themes/adminlte/views/layouts/partials/scripts.blade.php @@ -25,15 +25,25 @@ "use strict"; $("body").on("collapsed.lte.pushmenu", function(){ - if($.AdminLTESidebarTweak.options.EnableRemember){ - document.cookie = "toggleState=closed"; + if($.AdminLTESidebarTweak.options.EnableRemember) { + document.cookie = "toggleState=closed;path=/"; + + $("body").delay(500).queue(function () { + window.dispatchEvent(new Event('resize')); + $(this).dequeue(); + }); } }); // @todo this is not firing. - $("body").on("expanded.lte.pushmenu", function(){ + $("body").on("shown.lte.pushmenu", function(){ if($.AdminLTESidebarTweak.options.EnableRemember){ - document.cookie = "toggleState=opened"; + document.cookie = "toggleState=opened;path=/"; + + $("body").delay(500).queue(function () { + window.dispatchEvent(new Event('resize')); + $(this).dequeue(); + }); } });