Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
NAP-wordpress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marwa Sfari
NAP-wordpress
Commits
f48cd089
Commit
f48cd089
authored
Aug 28, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix]JIRA : Nap-20 ->Contact footer & load CMS page
parent
cd1ab84c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
82 deletions
+124
-82
main.js
wp-content/themes/nap/assets/js/main.js
+124
-82
No files found.
wp-content/themes/nap/assets/js/main.js
View file @
f48cd089
...
...
@@ -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,14 +43,7 @@ $(function(){
nav
.
stop
().
slideToggle
();
});
}
//load content page on left Panel
$
(
'.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
(){
$
.
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'
);
...
...
@@ -72,10 +66,20 @@ $(function(){
setTimeout
(
function
(){
$
(
'.gallery-wrapper'
).
removeClass
(
'hidden-elem'
).
addClass
(
'animated visible-elem fadeInUp'
);
},
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'
);
$
(
'.footer-home-content'
).
on
(
'click'
,
'.home-down:not(.scrolled)'
,
function
(
e
){
});
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'
);
...
...
@@ -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,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
.
getMenuBg
=
function
(){
});
}
$
.
fn
.
getMenuBg
=
function
(){
var
imgSrc
=
$
(
'header .nav-content > ul'
).
find
(
' > li.current'
).
data
(
'img'
),
windowWidth
=
$
(
window
).
width
(),
navwWidth
=
$
(
'.nav-wrapper'
).
width
(),
...
...
@@ -351,8 +356,8 @@ $.fn.getMenuBg = function(){
if
(
windowWidth
>
860
){
tlBg
.
to
(
'.container-bg'
,
1.2
,{
width
:
navwWidth
},
0.4
);
}
}
$
.
fn
.
appendMap
=
function
(){
}
$
.
fn
.
appendMap
=
function
(){
var
$this
=
$
(
this
);
if
(
!
(
this
.
find
(
'.map'
).
length
)){
this
.
append
(
$
(
'.map'
));
...
...
@@ -360,19 +365,19 @@ $.fn.appendMap = function(){
setTimeout
(
function
(){
initMap
();
},
330
)
}
$
.
fn
.
appendMobileMenu
=
function
(){
}
$
.
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
);
$
(
'.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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment