Skip to content

Commit d76ba2a

Browse files
committed
Remove the rtl condition
The `rtl` condition was a mistake and completely unnecessary
1 parent 0212879 commit d76ba2a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

slick/slick.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,16 +1062,12 @@
10621062
}
10631063

10641064
if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) {
1065-
if (_.options.rtl === true) {
1066-
_.slideOffset = ((_.slideWidth * -Math.floor(_.options.slidesToShow)) / 2) + ((_.slideWidth * _.slideCount) / 2);
1067-
} else {
1068-
_.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
1069-
}
1065+
_.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
10701066
} else if (_.options.centerMode === true && _.options.infinite === true) {
1071-
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
1067+
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
10721068
} else if (_.options.centerMode === true) {
1073-
_.slideOffset = 0;
1074-
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
1069+
_.slideOffset = 0;
1070+
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
10751071
}
10761072

10771073
if (_.options.vertical === false) {

0 commit comments

Comments
 (0)