Commit f48cd089 authored by imac's avatar imac

[Bugfix]JIRA : Nap-20 ->Contact footer & load CMS page

parent cd1ab84c
......@@ -3,12 +3,13 @@ var initFunction=function(){
};//END init Function
$(function(){
//Stop jump tag
$('a[href^="#"], .easyzoom a').click(function(e){
$(document).find('a[href^="#"], .easyzoom a').click(function(e){
e.preventDefault();
});
$(document).find('.contact-form h2').on('click', function(){
$(document).find('.contact-form .open-filter').on('click', function(){
$('.contact-form form').slideToggle();
$(this).toggleClass('on');
$(this).parent().find('h2').toggleClass('on');
checkFilterContactWrapper();
})
//Open Menu
......@@ -27,7 +28,7 @@ $(function(){
nav.parent().addClass("show-nav transition");
$('body').addClass('fixed');
if (!($('.main-nav .nav-content .footer').length)){
$('.main-nav .nav-content').append($('footer .footer').clone());
$('.main-nav .nav-content').append($('footer .footer').clone(true,true));
}
}
else { //Close menu
......@@ -42,48 +43,51 @@ $(function(){
nav.stop().slideToggle();
});
}
$.fn.loadPageContent = function(){
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
$('ul.phototheque').find('li').first().addClass('current');
$('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
var product = $('.list-animation article');
// TODO: Remove init classes , init attr on html
product.find('figure img,ul,h3,.new,.download-btn').attr( { 'data-animate':"", 'data-animation-classes':"animated fadeIn" } );
animateOnScroll();
scrollAnchor("#load-page", true);
$("#load-page").on("scroll",{ items: "ul.phototheque li .subcat a"},onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$('ul.phototheque').on('click',' li.parent-cat>a',function(e){
e.preventDefault();
e.stopPropagation();
$('.phototheque>li').removeClass('current');
$('.phototheque .subcat').slideUp('slow');
$(this).parent().addClass('current');
$('.phototheque .off .subcat').slideUp();
$(this).parent().find('.subcat').slideDown('slow');
});
setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
},0)
}
//load content page on left Panel
$('.footer .right li:not(.nl)').on('click','a',function(e){
$(document).find('.to-slide').on('click','a',function(e){
$('html').css('overflow','hidden');
e.preventDefault();
var link = $(this).attr("href");
$('.load-page').parent().addClass('active');
history.pushState(null, null, link);
$('.load-page').load(link,function(){
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
$('ul.phototheque').find('li').first().addClass('current');
$('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
var product = $('.list-animation article');
// TODO: Remove init classes , init attr on html
product.find('figure img,ul,h3,.new,.download-btn').attr( { 'data-animate':"", 'data-animation-classes':"animated fadeIn" } );
animateOnScroll();
scrollAnchor("#load-page", true);
$("#load-page").on("scroll",{ items: "ul.phototheque li .subcat a"},onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$('ul.phototheque').on('click',' li.parent-cat>a',function(e){
e.preventDefault();
e.stopPropagation();
$('.phototheque>li').removeClass('current');
$('.phototheque .subcat').slideUp('slow');
$(this).parent().addClass('current');
$('.phototheque .off .subcat').slideUp();
$(this).parent().find('.subcat').slideDown('slow');
});
setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
},0)
$.fn.loadPageContent();
});
});
var div = $('.nav-content');
$('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
TweenMax.killTweensOf('.nav-content');
var mainHeight = $('.main').outerHeight();
$(this).addClass('scrolled');
if (!($('.footer-home-content .nav-content').length)){
$('.footer-home-content').append($('.nav-content').clone());
$('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight());
$('.home-down-wrapper').css('top', - ($('.home-down-wrapper').outerHeight()));
$('.home-down').css('top', -($('.home-down').outerHeight()));
});
var div = $('.nav-content');
$('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
TweenMax.killTweensOf('.nav-content');
var mainHeight = $('.main').outerHeight();
$(this).addClass('scrolled');
if (!($('.footer-home-content .nav-content').length)){
$('.footer-home-content').append($('.nav-content').clone());
$('.main').outerHeight(mainHeight + $('.footer-home-content').outerHeight());
$('.home-down-wrapper').css('top', - ($('.home-down-wrapper').outerHeight()));
$('.home-down').css('top', -($('.home-down').outerHeight()));
//$('.home-down-wrapper').css('top','121px');
}
......@@ -219,10 +223,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
}
$.fn.open_filter = function(){
$(this).on('click','.filter-btn',function(){
var filterW = $('.filter-list').outerWidth();
var filterW = $('.filter-list').outerWidth(),
filterBtn =$('.filter-btn .btn-container').outerWidth();
tlFilter = new TimelineMax();
tlFilter.staggerFromTo('.filter-bloc',0.5,{opacity:0,y:100},{opacity:1,y:0},0.1,0);
tlFilter.fromTo('.filter-list',0.5,{opacity:0,left:'0',visibility:"hidden"},{opacity:1,left:filterW,visibility:"visible"},0);
tlFilter.fromTo('.filter-list',0.5,{opacity:0,left:'0',visibility:"hidden"},{opacity:1,left:filterW - filterBtn ,visibility:"visible"},0);
tlFilter.to('.filter-btn .btn-container',0.5,{opacity:0,left:filterW, width:"0px"},0);
//tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0);
......@@ -332,47 +337,47 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
}
},
});
$(document).on('click', '.moveDown', function(){
$.fn.fullpage.moveSectionDown();
});
}
$.fn.getMenuBg = function(){
var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'),
windowWidth = $(window).width(),
navwWidth = $('.nav-wrapper').width(),
navHeight = $('.nav-header').outerHeight();
$('.container-bg').css({
'background-image': "url("+ imgSrc +")",
'opacity' : 0,
})
tlBg = new TimelineMax();
tlBg.to('.container-bg',0.9,{opacity:1},0.5);
tlBg.from('.full-slides',1.2,{opacity:0, width:0},0.4);
if (windowWidth > 860){
tlBg.to('.container-bg',1.2,{width:navwWidth},0.4);
$(document).on('click', '.moveDown', function(){
$.fn.fullpage.moveSectionDown();
});
}
}
$.fn.appendMap = function(){
var $this = $(this);
if (!(this.find('.map').length)){
this.append($('.map'));
$.fn.getMenuBg = function(){
var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'),
windowWidth = $(window).width(),
navwWidth = $('.nav-wrapper').width(),
navHeight = $('.nav-header').outerHeight();
$('.container-bg').css({
'background-image': "url("+ imgSrc +")",
'opacity' : 0,
})
tlBg = new TimelineMax();
tlBg.to('.container-bg',0.9,{opacity:1},0.5);
tlBg.from('.full-slides',1.2,{opacity:0, width:0},0.4);
if (windowWidth > 860){
tlBg.to('.container-bg',1.2,{width:navwWidth},0.4);
}
}
setTimeout(function(){
initMap();
},330)
}
$.fn.appendMobileMenu = function(){
var $this = $(this);
setTimeout(function(){
if (!($this.find('li.current').length)){
$('.main-nav .nav-content li.current').addClass('to-replace');
$('.main-nav .nav-content li.current').clone().find('ul').remove().end().appendTo($this);
$this.find("li.current").append($('.main-nav.nav-wrapper li.current ul'));
$.fn.appendMap = function(){
var $this = $(this);
if (!(this.find('.map').length)){
this.append($('.map'));
}
$('.right-container').css('padding-top',$this.parent().outerHeight());
},2000)
setTimeout(function(){
initMap();
},330)
}
$.fn.appendMobileMenu = function(){
var $this = $(this);
setTimeout(function(){
if (!($this.find('li.current').length)){
$('.main-nav .nav-content li.current').addClass('to-replace');
$('.main-nav .nav-content li.current').clone(true).find('ul').remove().end().appendTo($this);
$this.find("li.current").append($('.main-nav.nav-wrapper li.current ul'));
}
$('.right-container').css('padding-top',$this.parent().outerHeight());
},2000)
}
}
//Responsive function
$.fn.responsive = function(){
var footerHeight = $('footer').height(),
......@@ -390,7 +395,6 @@ $.fn.appendMobileMenu = function(){
filterWidth = $('.right-container .left-panel').outerWidth(),
lastSectionHeight = $('#catalogue .panel-content section').last().outerHeight(),
footerContact = $('.contact-form .footer').outerHeight();
console.log(footerHeight);
$('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left',navPhototequeWidth) ;
$('.main,.load-page').outerHeight(containerHeight);
$('.full-height').outerHeight(maxHeight);
......@@ -409,9 +413,8 @@ $.fn.appendMobileMenu = function(){
$('#fullpage .chevron').css('left',navMenuWidth);
$('.container-bg').css({'height':'100%' , 'width' : navMenuWidth});
$('.main').css('padding-top',0);
$('.search-filter h2').removeClass('show-filter');
$('.contact-form h2').removeClass('show-comm');
$('.filter, .left-panel .map, .details').show();
$('.filter, .left-panel .map, .details, .contact-form form').show();
$('.left-panel').appendMap();
$('.filter-list,#home').css('margin-top',0);
$('.filter-list .top-header').css('top',"initial");
......@@ -421,7 +424,6 @@ $.fn.appendMobileMenu = function(){
$('.filter').appendMap();
$('.main').css('padding-top',navHeight);
$('.container-bg').css({'height':navHeight});
$('.search-filter h2').addClass('show-filter');
$('.contact-form h2').addClass('show-comm');
$('.filter-list').css('margin-top',navHeight);
$('.filter-list .top-header, .mobile-nav').css('top',navHeight);
......@@ -430,6 +432,17 @@ $.fn.appendMobileMenu = function(){
if ($('body #home').length){
$('.main').css('padding-top',0);
}
if ($('.filter-wrapper .header-filter-contact h2').hasClass('on')){
$('.filter, .left-panel .map, .details').show();
}else{
$('.filter, .left-panel .map, .details').hide();
}
if($('.contact-form h2').hasClass('on')){
$('.contact-form form').show();
}else{
$('.contact-form form').hide();
}
checkFilterContactWrapper();
}
checkFooterNavPosition();
}
......@@ -558,6 +571,25 @@ function checkFooterNavPosition(){
$('.header .nav-content .footer').removeClass('relative');
}
}
function checkFilterContactWrapper(){
setTimeout(function(){
if (
($('.contact-form .form-wrapper').outerHeight()
+ $('.filter-wrapper').outerHeight()
+ $('nav .main-nav').outerHeight() + $('.main-nav').outerHeight()) < $(window).outerHeight()
/*&&
( $('.contact-form .form-wrapper').outerHeight() +
$('.contact-form .footer').outerHeight() +
$('.filter-wrapper').outerHeight()
> $(window).outerHeight() )*/
)
{
$('.contact-form .footer').addClass('fixed');
}else{
$('.contact-form .footer').removeClass('fixed');
}
},500)
}
$(window).load( function() {
initFunction();
$('.header .nav-wrapper .nav-content > ul > li').each(function(){
......@@ -592,6 +624,15 @@ $(document).ready(function(){
$('.product-list article').each(function(){
$(this).showProductListColors();
});
$('.list-wrapper .color-list').each(function(){
var elem = $(this).find('input'),
isWhite = checkWhiteColor(elem.data('color'));
//console.log(isWhite + 'iswhite/color' + elem.data('color'));
if(isWhite != elem.data('color')){
elem.addClass('is-white');
}
});
setTimeout(function(){
onScrollCover();
}, 330);
......@@ -610,6 +651,7 @@ $(document).ready(function(){
$('.cover-wrapper').last().addClass('last');
$('.cover-wrapper').first().addClass('first');
showMap();
$.fn.loadPageContent();
}); //end document ready
$(window).resize(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment