Skip to content

Commit daf226b

Browse files
committed
fix for carousel filtering
1 parent df0125d commit daf226b

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

frontend/dist/scripts/app.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,26 +553,24 @@ function loadProjectRequirements(data) {
553553
let nextArrow = document.querySelector('[data-next-image]')
554554

555555
controls.addEventListener('click', e => {
556-
556+
console.log(currentIndex);
557557
if (e.target === prevArrow) {
558558

559-
if (currentIndex === 0) {
559+
if (currentIndex == 0) {
560560
currentIndex = projectFileData.currentMocks.length -1;
561561
} else {
562562
currentIndex -= 1;
563563
}
564-
565564
}
566565

567566
if (e.target === nextArrow) {
568-
if (currentIndex === projectFileData.currentMocks.length -1) {
567+
if (currentIndex == projectFileData.currentMocks.length -1) {
569568
currentIndex = 0;
570569
} else {
571570
currentIndex ++;
572571
}
573572
}
574-
575-
console.log(projectFileData.currentMocks.length);
573+
;
576574

577575
gallery.innerHTML = '';
578576
let currentMock = projectFileData.currentMocks[currentIndex];

frontend/src/scripts/app.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,26 +553,24 @@ function loadProjectRequirements(data) {
553553
let nextArrow = document.querySelector('[data-next-image]')
554554

555555
controls.addEventListener('click', e => {
556-
556+
console.log(currentIndex);
557557
if (e.target === prevArrow) {
558558

559-
if (currentIndex === 0) {
559+
if (currentIndex == 0) {
560560
currentIndex = projectFileData.currentMocks.length -1;
561561
} else {
562562
currentIndex -= 1;
563563
}
564-
565564
}
566565

567566
if (e.target === nextArrow) {
568-
if (currentIndex === projectFileData.currentMocks.length -1) {
567+
if (currentIndex == projectFileData.currentMocks.length -1) {
569568
currentIndex = 0;
570569
} else {
571570
currentIndex ++;
572571
}
573572
}
574-
575-
console.log(projectFileData.currentMocks.length);
573+
;
576574

577575
gallery.innerHTML = '';
578576
let currentMock = projectFileData.currentMocks[currentIndex];

0 commit comments

Comments
 (0)