Skip to content

Commit 7a07132

Browse files
committed
v1.0.0: Fix children behaviour
1 parent 7ac8d6f commit 7a07132

File tree

6 files changed

+2
-26
lines changed

6 files changed

+2
-26
lines changed

src/main.js

-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const init = () => {
3434
if (window.isInGridCarousel) {
3535
carouselGridMovement('left');
3636
} else if (window.childrenBetweenLeft) {
37-
window.actualVertical -= 1;
3837
focusNextCarousel('left');
3938
window.childrenBetweenLeft = false;
4039
} else if (window.isInNormalCarousel) {
@@ -45,7 +44,6 @@ const init = () => {
4544
if (window.isInGridCarousel) {
4645
carouselGridMovement('right');
4746
} else if (window.childrenBetweenRight) {
48-
window.actualVertical += 1;
4947
focusNextCarousel('right');
5048
window.childrenBetweenRight = false;
5149
} else if (window.isInNormalCarousel) {
@@ -56,7 +54,6 @@ const init = () => {
5654
if (window.isInGridCarousel) {
5755
carouselGridMovement('up');
5856
} else if (window.childrenBetweenUp) {
59-
window.actualVertical -= 1;
6057
focusNextCarousel('up');
6158
window.childrenBetweenUp = false;
6259
} else if (window.isInNormalCarousel) {
@@ -67,7 +64,6 @@ const init = () => {
6764
if (window.isInGridCarousel) {
6865
carouselGridMovement('down');
6966
} else if (window.childrenBetweenDown) {
70-
window.actualVertical += 1;
7167
focusNextCarousel('down');
7268
window.childrenBetweenDown = false;
7369
} else if (window.isInNormalCarousel) {

src/navigation.js

-8
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ const carouselGridMovement = (movement = 'down | up | left | right') => {
5959
carouselVerticalCenterGrid();
6060
} catch (e) {
6161
// There is not a next row, check if there is another carousel
62-
if (window.childrenBetweenUp) {
63-
window.actualVertical -= 1;
64-
window.childrenBetweenUp = false;
65-
}
6662
focusNextCarousel(movement);
6763
// Check if there are any open dialogs
6864
closeCarousel();
@@ -87,10 +83,6 @@ const carouselGridMovement = (movement = 'down | up | left | right') => {
8783
// Try getting previous or next row
8884
// Getting quanity of childs on previous or next row
8985
if (movement === 'right') {
90-
if (window.childrenBetweenRight) {
91-
window.actualVertical += 1;
92-
window.childrenBetweenRight = false;
93-
}
9486
if (focusNextCarousel(movement)) {
9587
// Check if there are any open dialogs
9688
closeDialogs();

usage-examples/angular-example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "navigation-example",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

usage-examples/angular-example/src/app/multiple-carousels/multiple-carousels.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class MultipleCarouselsComponent implements OnInit {
2222
keyDown(e: any) {
2323
// Left arrow
2424
if (e.keyCode === 37) {
25-
window.actualVertical = 3;
25+
window.actualVertical = 2; // The actual position is 2
2626
window.childrenBetweenLeft = true;
2727
}
2828
}

usage-examples/angular-example/src/assets/src/main.js

-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const init = () => {
3434
if (window.isInGridCarousel) {
3535
carouselGridMovement('left');
3636
} else if (window.childrenBetweenLeft) {
37-
window.actualVertical -= 1;
3837
focusNextCarousel('left');
3938
window.childrenBetweenLeft = false;
4039
} else if (window.isInNormalCarousel) {
@@ -45,7 +44,6 @@ const init = () => {
4544
if (window.isInGridCarousel) {
4645
carouselGridMovement('right');
4746
} else if (window.childrenBetweenRight) {
48-
window.actualVertical += 1;
4947
focusNextCarousel('right');
5048
window.childrenBetweenRight = false;
5149
} else if (window.isInNormalCarousel) {
@@ -56,7 +54,6 @@ const init = () => {
5654
if (window.isInGridCarousel) {
5755
carouselGridMovement('up');
5856
} else if (window.childrenBetweenUp) {
59-
window.actualVertical -= 1;
6057
focusNextCarousel('up');
6158
window.childrenBetweenUp = false;
6259
} else if (window.isInNormalCarousel) {
@@ -67,7 +64,6 @@ const init = () => {
6764
if (window.isInGridCarousel) {
6865
carouselGridMovement('down');
6966
} else if (window.childrenBetweenDown) {
70-
window.actualVertical += 1;
7167
focusNextCarousel('down');
7268
window.childrenBetweenDown = false;
7369
} else if (window.isInNormalCarousel) {

usage-examples/angular-example/src/assets/src/navigation.js

-8
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ const carouselGridMovement = (movement = 'down | up | left | right') => {
5959
carouselVerticalCenterGrid();
6060
} catch (e) {
6161
// There is not a next row, check if there is another carousel
62-
if (window.childrenBetweenUp) {
63-
window.actualVertical -= 1;
64-
window.childrenBetweenUp = false;
65-
}
6662
focusNextCarousel(movement);
6763
// Check if there are any open dialogs
6864
closeCarousel();
@@ -87,10 +83,6 @@ const carouselGridMovement = (movement = 'down | up | left | right') => {
8783
// Try getting previous or next row
8884
// Getting quanity of childs on previous or next row
8985
if (movement === 'right') {
90-
if (window.childrenBetweenRight) {
91-
window.actualVertical += 1;
92-
window.childrenBetweenRight = false;
93-
}
9486
if (focusNextCarousel(movement)) {
9587
// Check if there are any open dialogs
9688
closeDialogs();

0 commit comments

Comments
 (0)