55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<!-- REQUIRED JS SCRIPTS -->
|
|
<!-- JQuery and bootstrap are required by Laravel 5.7 in resources/js/bootstrap.js-->
|
|
<!-- Laravel App -->
|
|
<script src="{{ url(mix('/js/app.js')) }}" type="text/javascript"></script>
|
|
<!-- AdminLTE -->
|
|
<script src="/js/adminlte.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
// Our CSRF token to each interaction
|
|
$.ajaxSetup({
|
|
headers: {
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
}
|
|
});
|
|
|
|
$.AdminLTESidebarTweak = {};
|
|
|
|
$.AdminLTESidebarTweak.options = {
|
|
EnableRemember: true,
|
|
//Removes the transition after page reload.
|
|
NoTransitionAfterReload: false
|
|
};
|
|
|
|
$(function () {
|
|
"use strict";
|
|
|
|
$("body").on("collapsed.lte.pushmenu", function(){
|
|
if($.AdminLTESidebarTweak.options.EnableRemember){
|
|
document.cookie = "toggleState=closed";
|
|
}
|
|
});
|
|
|
|
// @todo this is not firing.
|
|
$("body").on("expanded.lte.pushmenu", function(){
|
|
if($.AdminLTESidebarTweak.options.EnableRemember){
|
|
document.cookie = "toggleState=opened";
|
|
}
|
|
});
|
|
|
|
if($.AdminLTESidebarTweak.options.EnableRemember){
|
|
var re = new RegExp('toggleState' + "=([^;]+)");
|
|
var value = re.exec(document.cookie);
|
|
var toggleState = (value != null) ? unescape(value[1]) : null;
|
|
if(toggleState == 'closed'){
|
|
if($.AdminLTESidebarTweak.options.NoTransitionAfterReload){
|
|
$("body").addClass('sidebar-collapse hold-transition').delay(100).queue(function(){
|
|
$(this).removeClass('hold-transition');
|
|
});
|
|
}else{
|
|
$("body").addClass('sidebar-collapse');
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</script> |