Server : nginx/1.18.0 System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64 User : www-data ( 33) PHP Version : 8.0.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/ecommerce/public/backend/js/ |
(function ($) {
"use strict"; // Start of use strict
// Toggle the side navigation
$("#sidebarToggle, #sidebarToggleTop").on("click", function (e) {
$("body").toggleClass("sidebar-toggled");
$(".sidebar").toggleClass("toggled");
if ($(".sidebar").hasClass("toggled")) {
$(".sidebar .collapse").collapse("hide");
}
});
$(window).resize(function () {
if ($(window).width() < 768) {
$(".sidebar .collapse").collapse("hide");
}
// Toggle the side navigation when window is resized below 480px
// if ($(window).width() < 480 && !$(".sidebar").hasClass("toggled")) {
// $("body").addClass("sidebar-toggled");
// $(".sidebar").addClass("toggled");
// $(".sidebar .collapse").collapse("hide");
// }
});
// Prevent the content wrapper from scrolling when the fixed side navigation hovered over
$("body.fixed-nav .sidebar").on(
"mousewheel DOMMouseScroll wheel",
function (e) {
if ($(window).width() > 768) {
var e0 = e.originalEvent,
delta = e0.wheelDelta || -e0.detail;
this.scrollTop += (delta < 0 ? 1 : -1) * 30;
e.preventDefault();
}
}
);
// Scroll to top button appear
$(document).on("scroll", function () {
var scrollDistance = $(this).scrollTop();
if (scrollDistance > 100) {
$(".scroll-to-top").fadeIn();
} else {
$(".scroll-to-top").fadeOut();
}
});
// Smooth scrolling using jQuery easing
$(document).on("click", "a.scroll-to-top", function (e) {
var $anchor = $(this);
$("html, body")
.stop()
.animate(
{
scrollTop: $($anchor.attr("href")).offset().top,
},
1000,
"easeInOutExpo"
);
e.preventDefault();
});
})(jQuery); // End of use strict