mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-09 08:11:30 +01:00
Admin Panel: save menu collapse state
This commit is contained in:
33
system/templates/admin.menu-collapse.html.twig
Normal file
33
system/templates/admin.menu-collapse.html.twig
Normal file
@@ -0,0 +1,33 @@
|
||||
<link rel="stylesheet" type="text/css" href="{{ constant('BASE_URL') }}tools/css/toastify.min.css">
|
||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/toastify.min.js"></script>
|
||||
{{ include('script.ajax-setup.html.twig') }}
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
/* Store sidebar state */
|
||||
$('.sidebar-toggle').on('click',function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const isCollapsed = $('body').hasClass('sidebar-collapse');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '{{ constant('ADMIN_URL') }}tools/menu_collapse.php',
|
||||
data : { collapse: !isCollapsed},
|
||||
success : function(response) {
|
||||
},
|
||||
error : function(response) {
|
||||
Toastify({
|
||||
position: 'center',
|
||||
text: response.responseText,
|
||||
duration: 3000,
|
||||
style: {
|
||||
background: 'red',
|
||||
},
|
||||
escapeMarkup: false,
|
||||
}).showToast();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user