home/autoph/public_html/projects/Rating-AutoHub/public/js/main.js 0000644 00000004052 15024772726 0021111 0 ustar 00 (function($){
"use strict";
// var fullHeight=function(){
// $('.js-fullheight').css('height',$(window).height());
// $(window).resize(function(){
// $('.js-fullheight').css('height',$(window).height());
// });};
// function delay(callback, ms) {
// var timer = 0;
// return function () {
// var context = this,
// args = arguments;
// clearTimeout(timer);
// timer = setTimeout(function () {
// callback.apply(context, args);
// }, ms || 0);
// };
// }
// fullHeight();
// $('#sidebarCollapse').on('click',function(){
// });
// $('#sidebar').class('active');
$(document).ready(function () {
// Function to toggle the sidebar
function toggleSidebar() {
var $sidebar = $("#sidebar");
var $content = $("#content");
$sidebar.toggleClass("active");
$content.toggleClass("active");
if (!$sidebar.hasClass("active")) {
$content.css("margin-left", "0"); // Adjust content margin when sidebar is inactive
}
}
// Add click event handler for the button
$("#sidebarCollapse").click(toggleSidebar);
// Function to handle window resize
function handleResize() {
var $sidebar = $("#sidebar");
var $content = $("#content");
if ($(window).width() >= 768 && $sidebar.hasClass("active")) {
// Restore default margin when window is large enough and sidebar is active
$sidebar.toggleClass('active');
$content.css("margin-left", "0");
} else if (!$sidebar.hasClass("active")) {
// Adjust content margin when sidebar is inactive on small screens
$content.css("margin-left", "0");
}
}
// Add window resize event handler
$(window).resize(handleResize);
// Initial setup based on window width
$(window).on("load", function () {
toggleSidebar();
handleResize();
$sidebar.toggleClass('active');
});
toggleSidebar();
});
})(jQuery);
home/autoph/public_html/connectv1/dist/js/main.js 0000644 00000003644 15031516014 0016042 0 ustar 00
$(function () {
// parameters
// folder
var url = window.location.href.split('#')[0];
url = url.split('?')[0];
const url_arr = url.split("/");
// for sidebar menu entirely but not cover treeview
$('ul.nav-sidebar a').filter(function() {
var href_arr = this.href.split("/");
// console.log( url_arr[3] +' - '+ href_arr[3]);
if(this.href == url ||
(url_arr[3] == href_arr[3] && $(this).attr('href') != '#')){
return true;
}else{
return false;
}
// return this.href == url;
}).addClass('active');
// for treeview
$('ul.nav-treeview a').filter(function() {
var href_arr = this.href.split("/");
if(this.href == url ||
(url_arr[3] == href_arr[3] && $(this).attr('href') != '#')){
return true;
}else{
return false;
}
// return this.href == url;
}).parentsUntil(".nav-sidebar > .nav-treeview").addClass('menu-open');
$("#notification-count").hide();
$.ajax({
url: "api/notification/notifications.php",
method: "POST",
data: {
apiKey: '2625558409416390'
},
cache: false,
beforeSend: function() {
$("#notification-count").hide();
},
success: function(data) {
}
})
});