$(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('
'+slider+'
'); } } }); // BASE MENU ========== $('ul.base-menu').show(); }; // FIXED HEADER function fixNav(){ if (!$('.cart-menu').length && !$('.-g-template-black-friday').length){ var nav = $('.main-header'); var pos = nav.height(); var posDelay = nav.height()*2; var prevScroll = 0; nav.addClass('fix-nav'); $(window).scroll(function () { var fix = ($(this).scrollTop() > posDelay) ? true : false; if(fix){ nav.addClass('fade-menu', fix); setTimeout(function() { nav.addClass('animate-menu'); }, 250); $('body').css('margin-top', pos); if($(this).scrollTop() > prevScroll){ nav.removeClass('active-menu'); }else{ nav.addClass('active-menu'); } }else{ $('body').css('margin-top', 0); nav.removeClass('fade-menu active-menu animate-menu', fix); } prevScroll = $(this).scrollTop(); }); } } $.Gomag.bind('Widget/Add/After', function(){ fixNav(); // BF SIDEBAR + MENU STICKY 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'}); } }); // 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'); }); // HEADER if($( window ).width() > 1090 ){ var sld_new_title = $('.slider_new_h .title-carousel').detach(); $('.slider_new_h .holder').append(sld_new_title); } // LIST if($('.category-sld').length){ $('.catTitle').insertBefore('.category-sld'); } $('.filter-group').addClass('clearfix'); $(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'); } }); //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'); }; //DETAIL if($('#product-page').length){ $('.breadcrumbs-default').insertBefore('.detail-title .title'); $('.thumb-h').addClass('horizontal').insertAfter('.vertical-slide-img'); $('.product-top .stock-status').insertAfter('.add-section .add2cart'); $('.detail-share').insertAfter('.wish-section'); $('.detail-page').next('.carousel-slide').addClass('detail-similar'); /* Inlocuit cu CSS, incurca la _Base if($( window ).width() > 1090 ){ var sld_sim_title = $('.detail-recomended .title-carousel').detach(); $('.detail-recomended .holder').append(sld_sim_title); } */ $('.prod-lg-sld .slick-prev').insertBefore('.prod-lg-sld .slick-next'); $('.prod-lg-sld .slick-dots').insertBefore('.prod-lg-sld .slick-next'); $('.detail-tabs h2').removeClass('resp-accordion'); } /* Nu functioneaza, sectiunea se incarca cu Ajax //comment box if($('.product-comment-box .comment-row').length){ $('.product-comment-box .comment-row').each(function(){ var title_com = $(this).find('.comment-title').detach(); var author_com = $(this).find('.comment-author').detach(); $(this).prepend('
'); var com_info = $(this).find('.com-left-side').nextAll('p').detach(); $(this).append('
'); $(this).find('.com-left-side').append(title_com, author_com); $(this).find('.com-right-side').append(com_info); var rev_title = $(this).find('.comment-title .title').detach(); $(this).find('.com-right-side').prepend(rev_title); }) } */ //CART if($('#shoppingcart').length){ $('.bottom-section .holder').remove(); } // After AJAX Complete $.Gomag.bind('Product/Details/After/Ajax/Load/Complete', function(response){ $('.breadcrumbs-default').insertBefore('.detail-title .title'); $('.thumb-h').addClass('horizontal').insertAfter('.vertical-slide-img'); $('.product-top .stock-status').insertAfter('.add-section .add2cart'); $('.detail-share').insertAfter('.wish-section'); }); }); /* desu-online js file */ function productThumbs(){ if($('.product-box').length){ $('.product-box').each(function(){ // if exist move it if($(this).find('.versionAttribute').length){ if($(this).find('.verAttrTop').length < 1){ $(this).find('.versionAttribute').insertBefore($(this).find('.top-side-box h2')); $(this).find('.versionAttribute').addClass('verAttrTop'); } } // if not exist create a fake if( $(this).parents('.carousel-slide').eq(0).find('.versionAttribute').length || $(this).parents('.product-listing').eq(0).find('.product .versionAttribute').length ){ if($(this).find('.versionAttribute').length < 1){ var getThisThumbUrl = $(this).find('.image-holder > a').attr('href'); var createFakeEl = '

 

'; $(createFakeEl).prependTo($(this).find('.top-side-box')); } } }); } }; productThumbs(); var ajxImgVersTarget = $('.product-box .versionAttribute ._versionAttribute'); function ajxImgVers(){ var thisVersion = ajxImgVersTarget; if(thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').length){ var getDataImg = thisVersion.attr('data-img'); if(typeof getDataImg === 'undefined'){ var axgImgParam = '?ajx=imgcall'; var whtToCall = ' .vertical-slide-img .prod-lg-sld li:first-child img'; var getUrl = thisVersion.attr('href')+axgImgParam; if(!thisVersion.parents('.product-box').eq(0).hasClass('load-img-ajx')){ var getTheMinHeight = thisVersion.parents('.product-box').eq(0).find('.image-holder .image').height(); thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').css('min-height',getTheMinHeight).css('object-fit','scale-down'); thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').attr('src','https://gomagcdn.ro/themes/fashion/gfx/svg/imgDots.svg'); thisVersion.parents('.product-box').eq(0).addClass('load-img-ajx'); if(thisVersion.attr('data-himg') === undefined){ thisVersion.parents('.product-box').eq(0).find('.image-holder .image').load(getUrl+whtToCall,function(data,status){ if(status == 'success'){ thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').removeAttr('class').removeAttr('data-zoom-image').removeAttr('data-full-image').removeAttr('data-id').addClass('img-responsive'); thisVersion.attr('data-himg',thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').attr('src')); thisVersion.parents('.product-box').eq(0).removeClass('load-img-ajx'); }else if(status == 'error'){ thisVersion.parents('.product-box').eq(0).removeClass('load-img-ajx'); } }); }else{ thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').attr('src',thisVersion.attr('data-himg')); thisVersion.parents('.product-box').eq(0).removeClass('load-img-ajx'); } } }else{ thisVersion.parents('.product-box').eq(0).addClass('load-img-ajx'); var getTheMinHeight = thisVersion.parents('.product-box').eq(0).find('.image-holder .image').height(); thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').css('min-height',getTheMinHeight).css('object-fit','scale-down'); thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').attr('src',getDataImg); thisVersion.parents('.product-box').eq(0).find('.image-holder .image img').load(function(){ thisVersion.parents('.product-box').eq(0).removeClass('load-img-ajx'); }); } } } $(document).on('mouseover','.product-box .versionAttribute ._versionAttribute',function(){ if($(window).width() > 1024){ ajxImgVersTarget = $(this); if(!ajxImgVersTarget.hasClass('fk_versionAttribute')){ ajxImgVers(); } } }); $(document).on('click','.product-box .versionAttribute ._versionAttribute',function(e){ if($(window).width() <= 1024){ ajxImgVersTarget = $(this); if(!ajxImgVersTarget.hasClass('fk_versionAttribute')){ ajxImgVers(); } e.preventDefault(); return false; } }); $(document).ajaxComplete(function(){ productThumbs(); })