small update

This commit is contained in:
2025-02-18 09:13:50 +01:00
parent 2045c5e5a7
commit 0ec2b29861
3 changed files with 112 additions and 43 deletions
+11 -8
View File
@@ -1,13 +1,14 @@
var as = {};
as.toggleSidebar = function () {
$(".sidebar").toggleClass('expanded');
$(".sidebar").toggleClass("expanded");
$("body").toggleClass("sidebar-enable"); // Permette di aggiungere uno stato globale
};
as.hideNotifications = function () {
$(".alert-notification").slideUp(600, function () {
$(this).remove();
})
});
};
as.updateSidebarSize = function () {
@@ -19,12 +20,14 @@ as.updateSidebarSize = function () {
};
as.init = function () {
$.ajaxSetup({
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
},
});
$("#sidebar-toggle").click(as.toggleSidebar);
// Aggiunto supporto per il tasto hamburger
$(".button-menu-mobile").click(as.toggleSidebar);
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
@@ -34,9 +37,9 @@ as.init = function () {
setTimeout(as.hideNotifications, 3500);
$("a[data-toggle=loader], button[data-toggle=loader]").click(function () {
if ($(this).parents('form').valid()) {
as.btn.loading($(this), $(this).data('loading-text'));
$(this).parents('form').submit();
if ($(this).parents("form").valid()) {
as.btn.loading($(this), $(this).data("loading-text"));
$(this).parents("form").submit();
}
});