Sindbad~EG File Manager

Current Path : /var/www/html/forumdainovacaors.com.br/wp-content/themes/itt/js/
Upload File :
Current File : /var/www/html/forumdainovacaors.com.br/wp-content/themes/itt/js/head-menu.js

// media query function for min-width: 992px (lg)
function minWidth992(x) {
    if (x.matches) { // If media query matches
      // make parent menu clickable link
      $('.navbar .dropdown > a').mousedown(function(e) {
        if (e.which == 1) {
          location.href = this.href;
        }
      });
    }
}
// Redirect when there is no child item
$('.navbar .dropdown > a').click(function(e) {
  if ($(this).closest('li').find('.dropdown-menu a').length == 0 && e.which == 1) {
    location.href = this.href;
  }
});

var mediaQuery992 = window.matchMedia("(min-width: 992px)");
minWidth992(mediaQuery992);
mediaQuery992.addListener(minWidth992);

$(window).scroll(function() {
  let logo = $('.image-logo img');
  let path = window.location.hostname;

  if(path.includes("localhost")) {
    // path += "/itt";
  }

  if ($(this).scrollTop() > 1){  
    $('nav').addClass("shrink");
    if(logo.attr('src') !== `http://${path}/wp-content/themes/itt/public/assets/images/logo-forum-white.svg`) {
      logo.attr('src',`http://${path}/wp-content/themes/itt/public/assets/images/logo-forum-white.svg`);
    }
  } else{
    $('nav').removeClass("shrink");
    if(logo.attr('src')!==`http://${path}/wp-content/themes/itt/public/assets/images/logotipos.svg`) {
      logo.attr('src',`http://${path}/wp-content/themes/itt/public/assets/images/logotipos.svg`);
    }
  }
});

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists