Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
9559c629
Commit
9559c629
authored
Mar 26, 2019
by
Sergio Adrian Gongora Euan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icon-eye in product list
parent
40cd8511
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
dataRetrieval.js
catalog/static/catalog/js/dataRetrieval.js
+14
-5
No files found.
catalog/static/catalog/js/dataRetrieval.js
View file @
9559c629
...
...
@@ -237,11 +237,15 @@ function drawApiResponse(element) {
if
(
data
.
uuid
===
element
.
id
.
replace
(
"-li"
,
''
))
{
console
.
log
(
"footprint:
\n
"
,
data
.
product
.
footprint
);
if
(
!
prevfeature
.
has
(
data
.
uuid
)){
element
.
style
.
textDecoration
=
'underline'
;
//element.style.textDecoration = 'underline';
let
divh4
=
element
.
children
[
0
].
children
[
1
].
children
[
0
];
divh4
.
innerHTML
=
divh4
.
textContent
+
' <i class="fa fa-eye" style="color:green"> </i>'
;
prevfeature
.
set
(
data
.
uuid
,
osmap
.
addfootprint
(
data
.
product
.
footprint
,
prevfeature
));
}
else
{
if
(
prevfeature
.
length
!=
0
){
element
.
style
.
textDecoration
=
'none'
;
//element.style.textDecoration = 'none';
let
divh4
=
element
.
children
[
0
].
children
[
1
].
children
[
0
]
divh4
.
innerHTML
=
divh4
.
textContent
+
' <i class="fa fa-eye-slash" style="color: #dd4b39"> </i>'
;
osmap
.
deletefootprint
(
prevfeature
.
get
(
data
.
uuid
));
prevfeature
.
delete
(
data
.
uuid
);
}
...
...
@@ -452,14 +456,13 @@ $(document).ready(function () {
success
:
function
(
res
)
{
data
.
img
=
res
.
img
;
var
temp
=
document
.
querySelector
(
'#product_list_template'
);
// filling template
temp
.
content
.
querySelector
(
'.single-product-input'
).
id
=
data
.
uuid
+
"-div"
;
temp
.
content
.
querySelector
(
'input'
).
value
=
data
.
uuid
;
temp
.
content
.
querySelector
(
'li'
).
id
=
data
.
uuid
+
"-li"
;
temp
.
content
.
querySelector
(
'h4'
).
id
=
data
.
uuid
+
"-h4"
;
temp
.
content
.
querySelector
(
'
h4'
).
textContent
=
data
.
product
.
producttype
+
"_"
+
data
.
product
.
tileid
;
temp
.
content
.
querySelector
(
'
p'
).
textContent
=
data
.
product
.
beginposition
;
temp
.
content
.
querySelector
(
'
p'
).
textContent
=
data
.
product
.
producttype
+
"_"
+
data
.
product
.
tileid
;
temp
.
content
.
querySelector
(
'
h4'
).
innerHTML
=
parserDate
(
data
.
product
.
beginposition
)
+
' <i class="fa fa-eye-slash" style="color: #dd4b39"> </i>'
;
temp
.
content
.
querySelector
(
'img'
).
src
=
"data:image/jpeg;base64, "
+
data
.
img
;
temp
.
content
.
querySelectorAll
(
'span'
)[
1
].
textContent
=
data
.
product
.
identifier
;
temp
.
content
.
querySelectorAll
(
'span'
)[
2
].
textContent
=
data
.
product
.
size
;
...
...
@@ -496,6 +499,12 @@ $(document).ready(function () {
});
});
function
parserDate
(
parsedate
){
let
fullDate
=
parsedate
.
split
(
'T'
);
let
date
=
fullDate
[
0
].
split
(
'-'
);
date
=
date
[
1
]
+
"/"
+
date
[
2
]
+
"/"
+
date
[
0
];
return
date
+
" "
+
fullDate
[
1
].
split
(
'.'
)[
0
];
}
// adds product to cart
$
(
'#product-to-cart-form'
).
submit
(
function
(
event
)
{
...
...
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