$(document).ready(function () {
if ($('.main-header .FH').length){
// FASHION DEPTH ==========
var fullMenu = '';
$('ul.base-menu li.ifDrop').each(function(){
fullMenu = fullMenu + '
';
});
$('.nav-menu.base-menu').addClass('container-h');
$('ul.base-menu li.all-product-button').remove();
$('ul.base-menu').prepend(fullMenu);
$('ul.base-menu li > a > i').removeClass('fa-angle-right');
$('ul.base-menu li > a > i').addClass('fa-angle-down');
$('ul.base-menu ul.drop-list').each(function(){
if(!$(this).parent('div.menu-dd').length){
$('').insertBefore($(this));
}
})
$('div.menu-dd').each(function(){
var image = $(this).next('ul.drop-list').find('li.image').html();
var slider = $(this).next('ul.drop-list').find('li.slider-menu').html();
$(this).next('ul.drop-list').find('li.image').remove();
$(this).next('ul.drop-list').find('li.slider-menu').remove();
var subcat = $(this).next('ul.drop-list').html();
if(subcat != undefined){
var w = $(this).next('ul.drop-list').hasClass('w60') ? 'w60' : 'w100';
$(this).next('ul.drop-list').remove();
$(this).append('');
if ( $(image).length ) {
$(this).append(''+image+'
');
}
if ( $(slider).length ) {
$(this).append('');
}
}
});
// BASE MENU ==========
$('ul.base-menu').show();
};
// FASHION MENU ==========
function Menu(){
$('.menu-dd').each(function() {
var $this = $(this);
var Nli = $this.find('li').length;
var Nlink = $this.find('a').length;
var Ncol = Math.ceil(Nlink / 15);
var Mbanner = $this.find('.cat-img').length;
Ncol = Ncol == 0 ? 1 : Ncol;
col = Nli > Ncol ? Ncol : Nli;
col = (col + (Mbanner ? 1 : 0) > 4) ? 4 : col;
$this.addClass('column' + col);
if (Mbanner){$this.addClass('banner');};
if ($this.find('li span > a').length == 0){
$this.addClass('no-sub');
};
if ($this.hasClass('column4')){
$this.parent().addClass('initial-h');
};
});
};
Menu();
$('.main-header .menu-drop').hover(function() {
$('.main-header .menu-drop .menu-dd').removeClass('open');
$(this).children('.menu-dd').stop().addClass('open');
if ( $('.slide-item-menu').length ) {
$('.slide-item-menu').owlCarousel({items:1,navigation:!0,pagination:!1});
// get owl element
var owl = $('.slide-item-menu');
// get owl instance from element
var owlInstance = owl.data('owlCarousel');
// if instance is existing
if(owlInstance != null)
owlInstance.reinit();
};
},function() {
$('.main-header .menu-drop .menu-dd').removeClass('open');
});
// BF SIDEBAR + MENU STICKY
$.Gomag.bind('Widget/Add/After', function(){
if($('.-g-template-black-friday').length){
$('.main-header').css({'top' : '-' + ($('.discount-tape').height() + $('.top-head-bg').height()) + 'px'});
}
if($( window ).width() > 991 && $('.-g-template-black-friday').length){
$('.landing-h .side-menu.fixed').css({'top' : $('#navigation').outerHeight() + 20 + 'px'});
}
});
$('#nav-filter:not(.mm-nav-filter) .option-group').addClass('ignoreMore');
//toggle filter
$(document).on('click', '#nav-filter:not(.mm-nav-filter) .filter.box .title-h', function(e){
e.preventDefault();
$(this).addClass('ignore');
$('#nav-filter:not(.mm-nav-filter) .filter.box .title-h').each(function(){
if(!$(this).hasClass('ignore')){
$(this).removeClass('ttl-bg')
}
})
$(this).removeClass('ignore');
$(this).toggleClass('ttl-bg');
$(this).next().addClass('ignoreSlide');
$('#nav-filter:not(.mm-nav-filter) .option-group').each(function(){
if(!$(this).hasClass('ignoreSlide')){
$(this).hide();
}
})
$(this).next().removeClass('ignoreSlide');
$(this).next().toggle();
});
$(document).mouseup(function(e) {
var container = $('#nav-filter:not(.mm-nav-filter) .filter.box:not(.-g-category-filters-remove-all)');
if (!container.is(e.target) && container.has(e.target).length === 0){
$(this).find('.option-group').removeClass('ignore').hide();
$(this).find('.title-h').removeClass('ttl-bg');
}
});
if($('.-g-pagetype-homepage').length){$('.main-header').addClass('over-top')};
//change filter holder
$('#nav-filter:not(.mm-nav-filter) .filter.box:not(.-g-category-filters-remove-all)').each(function(){
var filterh = $(this).html();
$(this).find('.title-h,.option-group,.more-filter').remove();
$(this).prepend(''+filterh+'
');
});
if ($(window).width() > 768) {
$('.result-section .order-type').insertAfter('.filter.box:last-child');
$('.order-type').addClass('filter box');
$('.list-grid').insertAfter('.order-type');
};
//footer holder
if ($('.bottom-section').length){
$('.bottom-section').before('');
$('.bottom-section').insertAfter('.append-footer');
$('footer').insertAfter('.bottom-section');
}else{
$('footer').before('');
$('footer').insertAfter('.append-footer');
}
$('.hellobar-itc').insertBefore('.top-head-bg');
var hellobar_2 = $('.hellobar-fashion').detach();
$('.main-header').append(hellobar_2);
});
/* dezmembraru js file */
/**
* Scrie aici codul tau Javascript...
*/
$.Gomag.bind('Advanced/Search/Element/Replace/After', function(event){
if($('.-g-advanced-search-30').find('select option:selected').val() == 'far-2' || $('.-g-advanced-search-30').find('input[class^="-g-searchbar-selected-input"]').val() == 'far-2')
{
if($('.-g-pagetype-homepage').length){
$('.-g-advanced-search-66').attr("style","display:block!important");
}
else
{
$('.-g-advanced-search-66').attr("style","display:inline-block!important");
}
}
else
{
$('.-g-advanced-search-66').css('display', 'none !important;');
}
})
var getDefTopSearch = $('.top-head .search-form-box .search-form');
var dinamicTxt = ' ÎNCEPEȚI SĂ CĂUTAȚI PIESE SAU SELECTAȚI UN AUTOMOBIL URMAND CEI 3 PASI:';
function searchbarHolder(){
var textArea = ''+dinamicTxt+'
';
if(
$('.-g-searchbar-holder .top-filter .type-h .input-s').length &&
$('.-g-homepage-main-slider #main-bnn').length
){
if(!$('.-g-searchbar-holder').hasClass('new-searchbar')){
$('.-g-searchbar-holder').prependTo('.-g-homepage-main-slider');
$('.-g-searchbar-holder').addClass('new-searchbar');
$('.-g-homepage-main-slider').addClass('new-main-slider');
$('body').addClass('b-new-main-slider');
}
if(
$('.new-searchbar').length &&
$('.new-searchbar .search-form').length < 1
){
getDefTopSearch.prependTo('.new-searchbar .top-filter');
}
if($('.-g-searchbar-holder .txt-filter').length < 1){
$(textArea).prependTo('.-g-searchbar-holder .top-filter');
}
}else if(
$('.-g-searchbar-holder .top-filter .type-h .input-s').length &&
$('#wrapper #category-page').length ||
$('.-g-searchbar-holder .top-filter .type-h .input-s').length &&
$('#wrapper #product-page').length
){
if(!$('.-g-searchbar-holder').hasClass('new-searchbar')){
//$('.-g-searchbar-holder').prependTo('.-g-homepage-main-slider');
$('.-g-searchbar-holder').addClass('new-searchbar');
$('body').addClass('bd-cat-filter');
}
if(
$('.new-searchbar').length &&
$('.new-searchbar .search-form').length < 1
){
getDefTopSearch.prependTo('.new-searchbar .top-filter');
}
if($('.-g-searchbar-holder .txt-filter').length < 1){
$(textArea).prependTo('.-g-searchbar-holder .top-filter');
}
}
// select title check
if($('.-g-searchbar-select option[selected="selected"]').length){
$('.-g-searchbar-select option[selected="selected"]').each(function(){
var getThisVal = $(this).text();
$(this).parent().attr('title',getThisVal);
});
}
}
searchbarHolder();
$(document).ajaxComplete(function(){
searchbarHolder();
})
$(document).ready(function() {
$('body').addClass('b-ready');
/* remove search bar from product page */
if($('#product-page').length && $(window).width() < 480){
$('.-g-searchbar-holder').remove();
}
// hide "/" from second phone number on product page
$('#product-page').find('a.-g-contact-phone2 span').addClass('hide');
// replace add to wihlist button
$('.wish-section a.wish-btn').remove();
$(".wish-section").prepend('Cauta Cod OEM');
});
$.Gomag.bind('Product/Details/After/Ajax/Load', function(response){
// replace add to wihlist button
$('.wish-section a.wish-btn').remove();
$(".wish-section").prepend('Cauta Cod OEM');
})
$(document).ready(function(){
$('#product-page .-g-product-details-help-phone').text('Comanda telefonica:');
$('#product-page .-g-product-details-code-prefix').text('Cod produs SKU:');
$(".resp-accordion:contains(Review)").hide();
});