Added state-save for open/cloed sidenav

This commit is contained in:
snipe 2017-10-25 20:10:41 -07:00
parent d008334f2d
commit d4bb4d2edd

View file

@ -6,7 +6,6 @@
<title> <title>
@section('title') @section('title')
@show @show
:: {{ $snipeSettings->site_name }} :: {{ $snipeSettings->site_name }}
</title> </title>
<!-- Tell the browser to be responsive to screen width --> <!-- Tell the browser to be responsive to screen width -->
@ -29,6 +28,7 @@
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
window.Laravel = { csrfToken: '{{ csrf_token() }}' }; window.Laravel = { csrfToken: '{{ csrf_token() }}' };
</script> </script>
<style nonce="{{ csrf_token() }}"> <style nonce="{{ csrf_token() }}">
@ -89,7 +89,7 @@
@endif @endif
<![endif]--> <![endif]-->
</head> </head>
<body class="hold-transition skin-blue sidebar-mini sidebar-collapse"> <body class="sidebar-mini skin-blue {{ (session('menu_state')!='open') ? 'sidebar-mini sidebar-collapse' : '' }}">
<div class="wrapper"> <div class="wrapper">
<header class="main-header"> <header class="main-header">
@ -732,11 +732,31 @@
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
$(function () { $(function () {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
})
$('body').bind('expanded.pushMenu', function() {
$.ajax({
type: 'GET',
url: "{{ route('account.menuprefs', ['state'=>'open']) }}",
_token: "{{ csrf_token() }}"
});
});
$('body').bind('collapsed.pushMenu', function() {
$.ajax({
type: 'GET',
url: "{{ route('account.menuprefs', ['state'=>'close']) }}",
_token: "{{ csrf_token() }}"
});
});
});
$(document).on('click', '[data-toggle="lightbox"]', function(event) { $(document).on('click', '[data-toggle="lightbox"]', function(event) {
event.preventDefault(); event.preventDefault();
$(this).ekkoLightbox(); $(this).ekkoLightbox();
}); });
</script> </script>
@if ((Session::get('topsearch')=='true') || (Request::is('/'))) @if ((Session::get('topsearch')=='true') || (Request::is('/')))