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(){ ...@@ -3,12 +3,13 @@ var initFunction=function(){
};//END init Function };//END init Function
$(function(){ $(function(){
//Stop jump tag //Stop jump tag
$('a[href^="#"], .easyzoom a').click(function(e){ $(document).find('a[href^="#"], .easyzoom a').click(function(e){
e.preventDefault(); e.preventDefault();
}); });
$(document).find('.contact-form h2').on('click', function(){ $(document).find('.contact-form .open-filter').on('click', function(){
$('.contact-form form').slideToggle(); $('.contact-form form').slideToggle();
$(this).toggleClass('on'); $(this).parent().find('h2').toggleClass('on');
checkFilterContactWrapper();
}) })
//Open Menu //Open Menu
...@@ -27,7 +28,7 @@ $(function(){ ...@@ -27,7 +28,7 @@ $(function(){
nav.parent().addClass("show-nav transition"); nav.parent().addClass("show-nav transition");
$('body').addClass('fixed'); $('body').addClass('fixed');
if (!($('.main-nav .nav-content .footer').length)){ 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 else { //Close menu
...@@ -42,14 +43,7 @@ $(function(){ ...@@ -42,14 +43,7 @@ $(function(){
nav.stop().slideToggle(); nav.stop().slideToggle();
}); });
} }
//load content page on left Panel $.fn.loadPageContent = function(){
$('.footer .right li:not(.nl)').on('click','a',function(e){
$('html').css('overflow','hidden');
e.preventDefault();
var link = $(this).attr("href");
$('.load-page').parent().addClass('active');
$('.load-page').load(link,function(){
//$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp') //$('.load-page').removeClass('fadeOutUp').addClass('animated fadeInUp')
$('ul.phototheque').find('li').first().addClass('current'); $('ul.phototheque').find('li').first().addClass('current');
$('ul.phototheque').find('li').first().find('.subcat').slideDown('slow'); $('ul.phototheque').find('li').first().find('.subcat').slideDown('slow');
...@@ -72,10 +66,20 @@ $(function(){ ...@@ -72,10 +66,20 @@ $(function(){
setTimeout(function(){ setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp'); $('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
},0) },0)
}
//load content page on left Panel
$(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(){
$.fn.loadPageContent();
}); });
}); });
var div = $('.nav-content'); var div = $('.nav-content');
$('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
TweenMax.killTweensOf('.nav-content'); TweenMax.killTweensOf('.nav-content');
var mainHeight = $('.main').outerHeight(); var mainHeight = $('.main').outerHeight();
$(this).addClass('scrolled'); $(this).addClass('scrolled');
...@@ -219,10 +223,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ ...@@ -219,10 +223,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
} }
$.fn.open_filter = function(){ $.fn.open_filter = function(){
$(this).on('click','.filter-btn',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 = new TimelineMax();
tlFilter.staggerFromTo('.filter-bloc',0.5,{opacity:0,y:100},{opacity:1,y:0},0.1,0); 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); 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); //tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0);
...@@ -332,11 +337,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){ ...@@ -332,11 +337,11 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
} }
}, },
}); });
$(document).on('click', '.moveDown', function(){ $(document).on('click', '.moveDown', function(){
$.fn.fullpage.moveSectionDown(); $.fn.fullpage.moveSectionDown();
}); });
} }
$.fn.getMenuBg = function(){ $.fn.getMenuBg = function(){
var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'), var imgSrc = $('header .nav-content > ul').find(' > li.current').data('img'),
windowWidth = $(window).width(), windowWidth = $(window).width(),
navwWidth = $('.nav-wrapper').width(), navwWidth = $('.nav-wrapper').width(),
...@@ -351,8 +356,8 @@ $.fn.getMenuBg = function(){ ...@@ -351,8 +356,8 @@ $.fn.getMenuBg = function(){
if (windowWidth > 860){ if (windowWidth > 860){
tlBg.to('.container-bg',1.2,{width:navwWidth},0.4); tlBg.to('.container-bg',1.2,{width:navwWidth},0.4);
} }
} }
$.fn.appendMap = function(){ $.fn.appendMap = function(){
var $this = $(this); var $this = $(this);
if (!(this.find('.map').length)){ if (!(this.find('.map').length)){
this.append($('.map')); this.append($('.map'));
...@@ -360,19 +365,19 @@ $.fn.appendMap = function(){ ...@@ -360,19 +365,19 @@ $.fn.appendMap = function(){
setTimeout(function(){ setTimeout(function(){
initMap(); initMap();
},330) },330)
} }
$.fn.appendMobileMenu = function(){ $.fn.appendMobileMenu = function(){
var $this = $(this); var $this = $(this);
setTimeout(function(){ setTimeout(function(){
if (!($this.find('li.current').length)){ if (!($this.find('li.current').length)){
$('.main-nav .nav-content li.current').addClass('to-replace'); $('.main-nav .nav-content li.current').addClass('to-replace');
$('.main-nav .nav-content li.current').clone().find('ul').remove().end().appendTo($this); $('.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')); $this.find("li.current").append($('.main-nav.nav-wrapper li.current ul'));
} }
$('.right-container').css('padding-top',$this.parent().outerHeight()); $('.right-container').css('padding-top',$this.parent().outerHeight());
},2000) },2000)
} }
//Responsive function //Responsive function
$.fn.responsive = function(){ $.fn.responsive = function(){
var footerHeight = $('footer').height(), var footerHeight = $('footer').height(),
...@@ -390,7 +395,6 @@ $.fn.appendMobileMenu = function(){ ...@@ -390,7 +395,6 @@ $.fn.appendMobileMenu = function(){
filterWidth = $('.right-container .left-panel').outerWidth(), filterWidth = $('.right-container .left-panel').outerWidth(),
lastSectionHeight = $('#catalogue .panel-content section').last().outerHeight(), lastSectionHeight = $('#catalogue .panel-content section').last().outerHeight(),
footerContact = $('.contact-form .footer').outerHeight(); footerContact = $('.contact-form .footer').outerHeight();
console.log(footerHeight);
$('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left',navPhototequeWidth) ; $('.gallery-wrapper').outerWidth(galleryWidth).css('margin-left',navPhototequeWidth) ;
$('.main,.load-page').outerHeight(containerHeight); $('.main,.load-page').outerHeight(containerHeight);
$('.full-height').outerHeight(maxHeight); $('.full-height').outerHeight(maxHeight);
...@@ -409,9 +413,8 @@ $.fn.appendMobileMenu = function(){ ...@@ -409,9 +413,8 @@ $.fn.appendMobileMenu = function(){
$('#fullpage .chevron').css('left',navMenuWidth); $('#fullpage .chevron').css('left',navMenuWidth);
$('.container-bg').css({'height':'100%' , 'width' : navMenuWidth}); $('.container-bg').css({'height':'100%' , 'width' : navMenuWidth});
$('.main').css('padding-top',0); $('.main').css('padding-top',0);
$('.search-filter h2').removeClass('show-filter');
$('.contact-form h2').removeClass('show-comm'); $('.contact-form h2').removeClass('show-comm');
$('.filter, .left-panel .map, .details').show(); $('.filter, .left-panel .map, .details, .contact-form form').show();
$('.left-panel').appendMap(); $('.left-panel').appendMap();
$('.filter-list,#home').css('margin-top',0); $('.filter-list,#home').css('margin-top',0);
$('.filter-list .top-header').css('top',"initial"); $('.filter-list .top-header').css('top',"initial");
...@@ -421,7 +424,6 @@ $.fn.appendMobileMenu = function(){ ...@@ -421,7 +424,6 @@ $.fn.appendMobileMenu = function(){
$('.filter').appendMap(); $('.filter').appendMap();
$('.main').css('padding-top',navHeight); $('.main').css('padding-top',navHeight);
$('.container-bg').css({'height':navHeight}); $('.container-bg').css({'height':navHeight});
$('.search-filter h2').addClass('show-filter');
$('.contact-form h2').addClass('show-comm'); $('.contact-form h2').addClass('show-comm');
$('.filter-list').css('margin-top',navHeight); $('.filter-list').css('margin-top',navHeight);
$('.filter-list .top-header, .mobile-nav').css('top',navHeight); $('.filter-list .top-header, .mobile-nav').css('top',navHeight);
...@@ -430,6 +432,17 @@ $.fn.appendMobileMenu = function(){ ...@@ -430,6 +432,17 @@ $.fn.appendMobileMenu = function(){
if ($('body #home').length){ if ($('body #home').length){
$('.main').css('padding-top',0); $('.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(); checkFooterNavPosition();
} }
...@@ -558,6 +571,25 @@ function checkFooterNavPosition(){ ...@@ -558,6 +571,25 @@ function checkFooterNavPosition(){
$('.header .nav-content .footer').removeClass('relative'); $('.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() { $(window).load( function() {
initFunction(); initFunction();
$('.header .nav-wrapper .nav-content > ul > li').each(function(){ $('.header .nav-wrapper .nav-content > ul > li').each(function(){
...@@ -592,6 +624,15 @@ $(document).ready(function(){ ...@@ -592,6 +624,15 @@ $(document).ready(function(){
$('.product-list article').each(function(){ $('.product-list article').each(function(){
$(this).showProductListColors(); $(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(){ setTimeout(function(){
onScrollCover(); onScrollCover();
}, 330); }, 330);
...@@ -610,6 +651,7 @@ $(document).ready(function(){ ...@@ -610,6 +651,7 @@ $(document).ready(function(){
$('.cover-wrapper').last().addClass('last'); $('.cover-wrapper').last().addClass('last');
$('.cover-wrapper').first().addClass('first'); $('.cover-wrapper').first().addClass('first');
showMap(); showMap();
$.fn.loadPageContent();
}); //end document ready }); //end document ready
$(window).resize(function() { $(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