Commit d6d5e92 1 parent ec4042f commit d6d5e92 Copy full SHA for d6d5e92
File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,21 @@ var helpers = {
80
80
} else {
81
81
this . autoPlay ( props . autoplay ) ;
82
82
}
83
+
84
+ const lazyLoadedList = this . state . lazyLoadedList
85
+ let startIndex , endIndex
86
+ if ( props . centerMode ) {
87
+ startIndex = this . state . currentSlide - props . slidesToShow / 2
88
+ endIndex = this . state . currentSlide + props . slidesToShow / 2
89
+ } else {
90
+ startIndex = this . state . currentSlide
91
+ endIndex = this . state . currentSlide + props . slidesToShow
92
+ }
93
+ for ( let slideIndex = startIndex ; slideIndex < endIndex ; slideIndex += 1 ) {
94
+ if ( lazyLoadedList . indexOf ( slideIndex ) < 0 ) {
95
+ lazyLoadedList . push ( slideIndex )
96
+ }
97
+ }
83
98
84
99
this . setState ( {
85
100
slideCount,
@@ -88,6 +103,7 @@ var helpers = {
88
103
trackWidth,
89
104
slideHeight,
90
105
listHeight,
106
+ lazyLoadedList
91
107
} , function ( ) {
92
108
93
109
var targetLeft = getTrackLeft ( assign ( {
You can’t perform that action at this time.
0 commit comments