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
153ed3ae
Commit
153ed3ae
authored
Aug 29, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix]Check disabled format
parent
d7825e95
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
product.js
wp-content/themes/nap/assets/js/product.js
+33
-5
No files found.
wp-content/themes/nap/assets/js/product.js
View file @
153ed3ae
...
...
@@ -32,6 +32,7 @@ function loadProductContent() {
$
(
'.pa_format li'
).
selectFormat
();
$
(
'.color-list.selected'
).
selectSlide
(
$
(
'#slides'
));
$
.
fn
.
getDownloadCurrentSlideLink
();
$
.
fn
.
checkIfFormatDisabled
();
//$('.btn-wrapper.close-panel').addClass('int-link');
},
300
)
$
(
'.download-btn:not(.download_file)'
).
click
(
function
(
e
){
...
...
@@ -108,6 +109,19 @@ $(function(){
}
})
}
$
.
fn
.
checkIfFormatDisabled
=
function
(){
var
format
=
getUrlParameter
(
'attribute_format'
);
var
activeImg
=
$
(
'.format-label #'
+
format
).
data
(
'img-active'
);
$
(
'.format-label #'
+
format
).
attr
(
'src'
,
activeImg
);
$
(
'.format-list'
).
each
(
function
()
{
if
(
$
(
this
).
find
(
"input"
).
is
(
':disabled'
))
{
$
(
this
).
addClass
(
"disabled"
);
}
else
{
$
(
this
).
removeClass
(
"disabled"
);
}
});
}
$
.
fn
.
getDownloadCurrentSlideLink
=
function
(){
var
img_link
=
$
(
document
).
find
(
'.slick-current a'
).
attr
(
'href'
);
if
(
img_link
){
...
...
@@ -191,12 +205,23 @@ $(function(){
$
(
'.product-details'
).
css
(
'right'
,
0
);
})
}
$
.
fn
.
productAnimation
=
function
(){
/********** NS *************/
var
getUrlParameter
=
function
getUrlParameter
(
sParam
)
{
var
sPageURL
=
decodeURIComponent
(
window
.
location
.
search
.
substring
(
1
)),
sURLVariables
=
sPageURL
.
split
(
'&'
),
sParameterName
,
i
;
//first format Actif
//var activeImg = $('.format-label #format_0').data('img-active');
//$('.format-label #format_0').attr('src',activeImg);
for
(
i
=
0
;
i
<
sURLVariables
.
length
;
i
++
)
{
sParameterName
=
sURLVariables
[
i
].
split
(
'='
);
if
(
sParameterName
[
0
]
===
sParam
)
{
return
sParameterName
[
1
]
===
undefined
?
true
:
sParameterName
[
1
];
}
}
}
/*********** END NS ************/
$
.
fn
.
productAnimation
=
function
(){
tlProduct
=
new
TimelineMax
();
tlProduct
.
fromTo
(
'.product-images'
,
0.4
,{
autoAlpha
:
0
,
marginLeft
:
"-10%"
},{
autoAlpha
:
1
,
marginLeft
:
"0"
},
0
);
tlProduct
.
staggerFromTo
(
'.product-details .list'
,
0.4
,{
opacity
:
0
,
marginLeft
:
"-10%"
},{
opacity
:
1
,
marginLeft
:
"0"
},
0.4
,
0.2
);
...
...
@@ -217,3 +242,6 @@ $(function(){
})
loadProductContent
();
});
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