slick_rails 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1e7a79075a11b484bc3b4acf293779c2644d69c
4
- data.tar.gz: 7b064576a6f7de025b46fde68bd471034246016f
3
+ metadata.gz: ba5d496049a9ee60caa15c9b5f79101cd7d7d465
4
+ data.tar.gz: de385c7a1b32db205b2421a5dc2c1ac29eb794fe
5
5
  SHA512:
6
- metadata.gz: 7b5086640348519bcc7f843b7f9ce5e0cad8578bd6938477f5cda551bcf51989ed208de0408392b7cbfa6a02e8a37f767bcf7e106962b054f796ab112b40bf74
7
- data.tar.gz: 6b1ba11746cc712962ec2dd10b934ecb5259635559ee74a5164a82bad62df14ff1950abc914ccfe88f3cdf58ba871a982d07edd9e04ce44b602558002a11c17a
6
+ metadata.gz: e534ba491e59e95d03d9e25a34dab73419fb3b80f91ecb7c6bfb53d4ecb65f9879b5a0a44e42eff6f620b1f37d5013f97f5cfdcf18ebcade42d2362500a3d900
7
+ data.tar.gz: e9d897a4c22ae29b18e75894819be80bf390782f792e6a583c2c32f0fe1041be19d7da730a226b8a5556e6ba2e63afa1517d1d8d36ad26e64fe1687403f1e7d7
@@ -1,2140 +1,2149 @@
1
1
  /*
2
- _ _ _ _
3
- ___| (_) ___| | __ (_)___
2
+ _ _ _ _
3
+ ___| (_) ___| | __ (_)___
4
4
  / __| | |/ __| |/ / | / __|
5
5
  \__ \ | | (__| < _ | \__ \
6
6
  |___/_|_|\___|_|\_(_)/ |___/
7
- |__/
7
+ |__/
8
8
 
9
- Version: 1.4.0
10
- Author: Ken Wheeler
11
- Website: http://kenwheeler.github.io
12
- Docs: http://kenwheeler.github.io/slick
13
- Repo: http://github.com/kenwheeler/slick
14
- Issues: http://github.com/kenwheeler/slick/issues
9
+ Version: 1.4.1
10
+ Author: Ken Wheeler
11
+ Website: http://kenwheeler.github.io
12
+ Docs: http://kenwheeler.github.io/slick
13
+ Repo: http://github.com/kenwheeler/slick
14
+ Issues: http://github.com/kenwheeler/slick/issues
15
15
 
16
- */
16
+ */
17
17
 
18
18
  /* global window, document, define, jQuery, setInterval, clearInterval */
19
19
 
20
20
  (function(factory) {
21
- 'use strict';
22
- if (typeof define === 'function' && define.amd) {
23
- define(['jquery'], factory);
24
- } else if (typeof exports !== 'undefined') {
25
- module.exports = factory(require('jquery'));
26
- } else {
27
- factory(jQuery);
28
- }
21
+ 'use strict';
22
+ if (typeof define === 'function' && define.amd) {
23
+ define(['jquery'], factory);
24
+ } else if (typeof exports !== 'undefined') {
25
+ module.exports = factory(require('jquery'));
26
+ } else {
27
+ factory(jQuery);
28
+ }
29
29
 
30
30
  }(function($) {
31
- 'use strict';
32
- var Slick = window.Slick || {};
33
-
34
- Slick = (function() {
35
-
36
- var instanceUid = 0;
37
-
38
- function Slick(element, settings) {
39
-
40
- var _ = this,
41
- dataSettings, responsiveSettings, breakpoint;
42
-
43
- _.defaults = {
44
- accessibility: true,
45
- adaptiveHeight: false,
46
- appendArrows: $(element),
47
- appendDots: $(element),
48
- arrows: true,
49
- asNavFor: null,
50
- prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="previous">Previous</button>',
51
- nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="next">Next</button>',
52
- autoplay: false,
53
- autoplaySpeed: 3000,
54
- centerMode: false,
55
- centerPadding: '50px',
56
- cssEase: 'ease',
57
- customPaging: function(slider, i) {
58
- return '<button type="button" data-role="none">' + (i + 1) + '</button>';
59
- },
60
- dots: false,
61
- dotsClass: 'slick-dots',
62
- draggable: true,
63
- easing: 'linear',
64
- edgeFriction: 0.35,
65
- fade: false,
66
- focusOnSelect: false,
67
- infinite: true,
68
- initialSlide: 0,
69
- lazyLoad: 'ondemand',
70
- mobileFirst: false,
71
- pauseOnHover: true,
72
- pauseOnDotsHover: false,
73
- respondTo: 'window',
74
- responsive: null,
75
- rtl: false,
76
- slide: '',
77
- slidesToShow: 1,
78
- slidesToScroll: 1,
79
- speed: 500,
80
- swipe: true,
81
- swipeToSlide: false,
82
- touchMove: true,
83
- touchThreshold: 5,
84
- useCSS: true,
85
- variableWidth: false,
86
- vertical: false,
87
- waitForAnimate: true
88
- };
89
-
90
- _.initials = {
91
- animating: false,
92
- dragging: false,
93
- autoPlayTimer: null,
94
- currentDirection: 0,
95
- currentLeft: null,
96
- currentSlide: 0,
97
- direction: 1,
98
- $dots: null,
99
- listWidth: null,
100
- listHeight: null,
101
- loadIndex: 0,
102
- $nextArrow: null,
103
- $prevArrow: null,
104
- slideCount: null,
105
- slideWidth: null,
106
- $slideTrack: null,
107
- $slides: null,
108
- sliding: false,
109
- slideOffset: 0,
110
- swipeLeft: null,
111
- $list: null,
112
- touchObject: {},
113
- transformsEnabled: false
114
- };
115
-
116
- $.extend(_, _.initials);
117
-
118
- _.activeBreakpoint = null;
119
- _.animType = null;
120
- _.animProp = null;
121
- _.breakpoints = [];
122
- _.breakpointSettings = [];
123
- _.cssTransitions = false;
124
- _.hidden = "hidden";
125
- _.paused = false;
126
- _.positionProp = null;
127
- _.respondTo = null;
128
- _.shouldClick = true;
129
- _.$slider = $(element);
130
- _.$slidesCache = null;
131
- _.transformType = null;
132
- _.transitionType = null;
133
- _.visibilityChange = "visibilitychange";
134
- _.windowWidth = 0;
135
- _.windowTimer = null;
136
-
137
- dataSettings = $(element).data('slick') || {};
138
-
139
- _.options = $.extend({}, _.defaults, dataSettings, settings);
140
-
141
- _.currentSlide = _.options.initialSlide;
142
-
143
- _.originalSettings = _.options;
144
- responsiveSettings = _.options.responsive || null;
145
-
146
- if (responsiveSettings && responsiveSettings.length > -1) {
147
- _.respondTo = _.options.respondTo || "window";
148
- for (breakpoint in responsiveSettings) {
149
- if (responsiveSettings.hasOwnProperty(breakpoint)) {
150
- _.breakpoints.push(responsiveSettings[
151
- breakpoint].breakpoint);
152
- _.breakpointSettings[responsiveSettings[
153
- breakpoint].breakpoint] =
154
- responsiveSettings[breakpoint].settings;
31
+ 'use strict';
32
+ var Slick = window.Slick || {};
33
+
34
+ Slick = (function() {
35
+
36
+ var instanceUid = 0;
37
+
38
+ function Slick(element, settings) {
39
+
40
+ var _ = this,
41
+ dataSettings, responsiveSettings, breakpoint;
42
+
43
+ _.defaults = {
44
+ accessibility: true,
45
+ adaptiveHeight: false,
46
+ appendArrows: $(element),
47
+ appendDots: $(element),
48
+ arrows: true,
49
+ asNavFor: null,
50
+ prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="previous">Previous</button>',
51
+ nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="next">Next</button>',
52
+ autoplay: false,
53
+ autoplaySpeed: 3000,
54
+ centerMode: false,
55
+ centerPadding: '50px',
56
+ cssEase: 'ease',
57
+ customPaging: function(slider, i) {
58
+ return '<button type="button" data-role="none">' + (i + 1) + '</button>';
59
+ },
60
+ dots: false,
61
+ dotsClass: 'slick-dots',
62
+ draggable: true,
63
+ easing: 'linear',
64
+ edgeFriction: 0.35,
65
+ fade: false,
66
+ focusOnSelect: false,
67
+ infinite: true,
68
+ initialSlide: 0,
69
+ lazyLoad: 'ondemand',
70
+ mobileFirst: false,
71
+ pauseOnHover: true,
72
+ pauseOnDotsHover: false,
73
+ respondTo: 'window',
74
+ responsive: null,
75
+ rtl: false,
76
+ slide: '',
77
+ slidesToShow: 1,
78
+ slidesToScroll: 1,
79
+ speed: 500,
80
+ swipe: true,
81
+ swipeToSlide: false,
82
+ touchMove: true,
83
+ touchThreshold: 5,
84
+ useCSS: true,
85
+ variableWidth: false,
86
+ vertical: false,
87
+ waitForAnimate: true
88
+ };
89
+
90
+ _.initials = {
91
+ animating: false,
92
+ dragging: false,
93
+ autoPlayTimer: null,
94
+ currentDirection: 0,
95
+ currentLeft: null,
96
+ currentSlide: 0,
97
+ direction: 1,
98
+ $dots: null,
99
+ listWidth: null,
100
+ listHeight: null,
101
+ loadIndex: 0,
102
+ $nextArrow: null,
103
+ $prevArrow: null,
104
+ slideCount: null,
105
+ slideWidth: null,
106
+ $slideTrack: null,
107
+ $slides: null,
108
+ sliding: false,
109
+ slideOffset: 0,
110
+ swipeLeft: null,
111
+ $list: null,
112
+ touchObject: {},
113
+ transformsEnabled: false
114
+ };
115
+
116
+ $.extend(_, _.initials);
117
+
118
+ _.activeBreakpoint = null;
119
+ _.animType = null;
120
+ _.animProp = null;
121
+ _.breakpoints = [];
122
+ _.breakpointSettings = [];
123
+ _.cssTransitions = false;
124
+ _.hidden = "hidden";
125
+ _.paused = false;
126
+ _.positionProp = null;
127
+ _.respondTo = null;
128
+ _.shouldClick = true;
129
+ _.$slider = $(element);
130
+ _.$slidesCache = null;
131
+ _.transformType = null;
132
+ _.transitionType = null;
133
+ _.visibilityChange = "visibilitychange";
134
+ _.windowWidth = 0;
135
+ _.windowTimer = null;
136
+
137
+ dataSettings = $(element).data('slick') || {};
138
+
139
+ _.options = $.extend({}, _.defaults, dataSettings, settings);
140
+
141
+ _.currentSlide = _.options.initialSlide;
142
+
143
+ _.originalSettings = _.options;
144
+ responsiveSettings = _.options.responsive || null;
145
+
146
+ if (responsiveSettings && responsiveSettings.length > -1) {
147
+ _.respondTo = _.options.respondTo || "window";
148
+ for (breakpoint in responsiveSettings) {
149
+ if (responsiveSettings.hasOwnProperty(breakpoint)) {
150
+ _.breakpoints.push(responsiveSettings[
151
+ breakpoint].breakpoint);
152
+ _.breakpointSettings[responsiveSettings[
153
+ breakpoint].breakpoint] =
154
+ responsiveSettings[breakpoint].settings;
155
+ }
156
+ }
157
+ _.breakpoints.sort(function(a, b) {
158
+ if(_.options.mobileFirst === true) {
159
+ return a - b;
160
+ } else {
161
+ return b - a;
162
+ }
163
+ });
155
164
  }
156
- }
157
- _.breakpoints.sort(function(a, b) {
158
- if(_.options.mobileFirst === true) {
159
- return a - b;
160
- } else {
161
- return b - a;
165
+
166
+ if (typeof document.mozHidden !== "undefined") {
167
+ _.hidden = "mozHidden";
168
+ _.visibilityChange = "mozvisibilitychange";
169
+ } else if (typeof document.msHidden !== "undefined") {
170
+ _.hidden = "msHidden";
171
+ _.visibilityChange = "msvisibilitychange";
172
+ } else if (typeof document.webkitHidden !== "undefined") {
173
+ _.hidden = "webkitHidden";
174
+ _.visibilityChange = "webkitvisibilitychange";
162
175
  }
163
- });
164
- }
165
-
166
- if (typeof document.mozHidden !== "undefined") {
167
- _.hidden = "mozHidden";
168
- _.visibilityChange = "mozvisibilitychange";
169
- } else if (typeof document.msHidden !== "undefined") {
170
- _.hidden = "msHidden";
171
- _.visibilityChange = "msvisibilitychange";
172
- } else if (typeof document.webkitHidden !== "undefined") {
173
- _.hidden = "webkitHidden";
174
- _.visibilityChange = "webkitvisibilitychange";
175
- }
176
-
177
- _.autoPlay = $.proxy(_.autoPlay, _);
178
- _.autoPlayClear = $.proxy(_.autoPlayClear, _);
179
- _.changeSlide = $.proxy(_.changeSlide, _);
180
- _.clickHandler = $.proxy(_.clickHandler, _);
181
- _.selectHandler = $.proxy(_.selectHandler, _);
182
- _.setPosition = $.proxy(_.setPosition, _);
183
- _.swipeHandler = $.proxy(_.swipeHandler, _);
184
- _.dragHandler = $.proxy(_.dragHandler, _);
185
- _.keyHandler = $.proxy(_.keyHandler, _);
186
- _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
187
-
188
- _.instanceUid = instanceUid++;
189
-
190
- // A simple way to check for HTML strings
191
- // Strict HTML recognition (must start with <)
192
- // Extracted from jQuery v1.11 source
193
- _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
194
176
 
195
- _.init();
177
+ _.autoPlay = $.proxy(_.autoPlay, _);
178
+ _.autoPlayClear = $.proxy(_.autoPlayClear, _);
179
+ _.changeSlide = $.proxy(_.changeSlide, _);
180
+ _.clickHandler = $.proxy(_.clickHandler, _);
181
+ _.selectHandler = $.proxy(_.selectHandler, _);
182
+ _.setPosition = $.proxy(_.setPosition, _);
183
+ _.swipeHandler = $.proxy(_.swipeHandler, _);
184
+ _.dragHandler = $.proxy(_.dragHandler, _);
185
+ _.keyHandler = $.proxy(_.keyHandler, _);
186
+ _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
196
187
 
197
- _.checkResponsive();
188
+ _.instanceUid = instanceUid++;
198
189
 
199
- }
190
+ // A simple way to check for HTML strings
191
+ // Strict HTML recognition (must start with <)
192
+ // Extracted from jQuery v1.11 source
193
+ _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
200
194
 
201
- return Slick;
195
+ _.init();
196
+
197
+ _.checkResponsive(true);
198
+
199
+ }
200
+
201
+ return Slick;
202
202
 
203
203
  }());
204
204
 
205
205
  Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
206
206
 
207
- var _ = this;
207
+ var _ = this;
208
208
 
209
- if (typeof(index) === 'boolean') {
210
- addBefore = index;
211
- index = null;
212
- } else if (index < 0 || (index >= _.slideCount)) {
213
- return false;
214
- }
209
+ if (typeof(index) === 'boolean') {
210
+ addBefore = index;
211
+ index = null;
212
+ } else if (index < 0 || (index >= _.slideCount)) {
213
+ return false;
214
+ }
215
215
 
216
- _.unload();
216
+ _.unload();
217
217
 
218
- if (typeof(index) === 'number') {
219
- if (index === 0 && _.$slides.length === 0) {
220
- $(markup).appendTo(_.$slideTrack);
221
- } else if (addBefore) {
222
- $(markup).insertBefore(_.$slides.eq(index));
223
- } else {
224
- $(markup).insertAfter(_.$slides.eq(index));
225
- }
226
- } else {
227
- if (addBefore === true) {
228
- $(markup).prependTo(_.$slideTrack);
218
+ if (typeof(index) === 'number') {
219
+ if (index === 0 && _.$slides.length === 0) {
220
+ $(markup).appendTo(_.$slideTrack);
221
+ } else if (addBefore) {
222
+ $(markup).insertBefore(_.$slides.eq(index));
223
+ } else {
224
+ $(markup).insertAfter(_.$slides.eq(index));
225
+ }
229
226
  } else {
230
- $(markup).appendTo(_.$slideTrack);
227
+ if (addBefore === true) {
228
+ $(markup).prependTo(_.$slideTrack);
229
+ } else {
230
+ $(markup).appendTo(_.$slideTrack);
231
+ }
231
232
  }
232
- }
233
233
 
234
- _.$slides = _.$slideTrack.children(this.options.slide);
234
+ _.$slides = _.$slideTrack.children(this.options.slide);
235
235
 
236
- _.$slideTrack.children(this.options.slide).detach();
236
+ _.$slideTrack.children(this.options.slide).detach();
237
237
 
238
- _.$slideTrack.append(_.$slides);
238
+ _.$slideTrack.append(_.$slides);
239
239
 
240
- _.$slides.each(function(index, element) {
241
- $(element).attr("data-slick-index",index);
242
- });
240
+ _.$slides.each(function(index, element) {
241
+ $(element).attr("data-slick-index",index);
242
+ });
243
243
 
244
- _.$slidesCache = _.$slides;
244
+ _.$slidesCache = _.$slides;
245
245
 
246
- _.reinit();
246
+ _.reinit();
247
247
 
248
248
  };
249
249
 
250
250
  Slick.prototype.animateHeight = function(){
251
- var _ = this;
252
- if(_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
253
- var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
254
- _.$list.animate({height: targetHeight},_.options.speed);
255
- }
251
+ var _ = this;
252
+ if(_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
253
+ var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
254
+ _.$list.animate({height: targetHeight},_.options.speed);
255
+ }
256
256
  };
257
257
 
258
258
  Slick.prototype.animateSlide = function(targetLeft, callback) {
259
259
 
260
- var animProps = {}, _ = this;
260
+ var animProps = {}, _ = this;
261
261
 
262
- _.animateHeight();
262
+ _.animateHeight();
263
263
 
264
- if (_.options.rtl === true && _.options.vertical === false) {
265
- targetLeft = -targetLeft;
266
- }
267
- if (_.transformsEnabled === false) {
268
- if (_.options.vertical === false) {
269
- _.$slideTrack.animate({
270
- left: targetLeft
271
- }, _.options.speed, _.options.easing, callback);
272
- } else {
273
- _.$slideTrack.animate({
274
- top: targetLeft
275
- }, _.options.speed, _.options.easing, callback);
264
+ if (_.options.rtl === true && _.options.vertical === false) {
265
+ targetLeft = -targetLeft;
276
266
  }
277
-
278
- } else {
279
-
280
- if (_.cssTransitions === false) {
281
- if (_.options.rtl === true) {
282
- _.currentLeft = -(_.currentLeft);
283
- }
284
- $({
285
- animStart: _.currentLeft
286
- }).animate({
287
- animStart: targetLeft
288
- }, {
289
- duration: _.options.speed,
290
- easing: _.options.easing,
291
- step: function(now) {
292
- now = Math.ceil(now);
293
- if (_.options.vertical === false) {
294
- animProps[_.animType] = 'translate(' +
295
- now + 'px, 0px)';
296
- _.$slideTrack.css(animProps);
297
- } else {
298
- animProps[_.animType] = 'translate(0px,' +
299
- now + 'px)';
300
- _.$slideTrack.css(animProps);
301
- }
302
- },
303
- complete: function() {
304
- if (callback) {
305
- callback.call();
306
- }
267
+ if (_.transformsEnabled === false) {
268
+ if (_.options.vertical === false) {
269
+ _.$slideTrack.animate({
270
+ left: targetLeft
271
+ }, _.options.speed, _.options.easing, callback);
272
+ } else {
273
+ _.$slideTrack.animate({
274
+ top: targetLeft
275
+ }, _.options.speed, _.options.easing, callback);
307
276
  }
308
- });
309
277
 
310
278
  } else {
311
279
 
312
- _.applyTransition();
313
- targetLeft = Math.ceil(targetLeft);
280
+ if (_.cssTransitions === false) {
281
+ if (_.options.rtl === true) {
282
+ _.currentLeft = -(_.currentLeft);
283
+ }
284
+ $({
285
+ animStart: _.currentLeft
286
+ }).animate({
287
+ animStart: targetLeft
288
+ }, {
289
+ duration: _.options.speed,
290
+ easing: _.options.easing,
291
+ step: function(now) {
292
+ now = Math.ceil(now);
293
+ if (_.options.vertical === false) {
294
+ animProps[_.animType] = 'translate(' +
295
+ now + 'px, 0px)';
296
+ _.$slideTrack.css(animProps);
297
+ } else {
298
+ animProps[_.animType] = 'translate(0px,' +
299
+ now + 'px)';
300
+ _.$slideTrack.css(animProps);
301
+ }
302
+ },
303
+ complete: function() {
304
+ if (callback) {
305
+ callback.call();
306
+ }
307
+ }
308
+ });
314
309
 
315
- if (_.options.vertical === false) {
316
- animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
317
- } else {
318
- animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
319
- }
320
- _.$slideTrack.css(animProps);
310
+ } else {
321
311
 
322
- if (callback) {
323
- setTimeout(function() {
312
+ _.applyTransition();
313
+ targetLeft = Math.ceil(targetLeft);
324
314
 
325
- _.disableTransition();
315
+ if (_.options.vertical === false) {
316
+ animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
317
+ } else {
318
+ animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
319
+ }
320
+ _.$slideTrack.css(animProps);
326
321
 
327
- callback.call();
328
- }, _.options.speed);
329
- }
322
+ if (callback) {
323
+ setTimeout(function() {
330
324
 
331
- }
325
+ _.disableTransition();
332
326
 
333
- }
327
+ callback.call();
328
+ }, _.options.speed);
329
+ }
330
+
331
+ }
332
+
333
+ }
334
334
 
335
335
  };
336
336
 
337
337
  Slick.prototype.asNavFor = function(index) {
338
- var _ = this, asNavFor = _.options.asNavFor !== null ? $(_.options.asNavFor).slick('getSlick') : null;
339
- if(asNavFor !== null) asNavFor.slideHandler(index, true);
338
+ var _ = this, asNavFor = _.options.asNavFor !== null ? $(_.options.asNavFor).slick('getSlick') : null;
339
+ if(asNavFor !== null) asNavFor.slideHandler(index, true);
340
340
  };
341
341
 
342
342
  Slick.prototype.applyTransition = function(slide) {
343
343
 
344
- var _ = this,
345
- transition = {};
344
+ var _ = this,
345
+ transition = {};
346
346
 
347
- if (_.options.fade === false) {
348
- transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
349
- } else {
350
- transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
351
- }
347
+ if (_.options.fade === false) {
348
+ transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
349
+ } else {
350
+ transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
351
+ }
352
352
 
353
- if (_.options.fade === false) {
354
- _.$slideTrack.css(transition);
355
- } else {
356
- _.$slides.eq(slide).css(transition);
357
- }
353
+ if (_.options.fade === false) {
354
+ _.$slideTrack.css(transition);
355
+ } else {
356
+ _.$slides.eq(slide).css(transition);
357
+ }
358
358
 
359
359
  };
360
360
 
361
361
  Slick.prototype.autoPlay = function() {
362
362
 
363
- var _ = this;
363
+ var _ = this;
364
364
 
365
- if (_.autoPlayTimer) {
366
- clearInterval(_.autoPlayTimer);
367
- }
365
+ if (_.autoPlayTimer) {
366
+ clearInterval(_.autoPlayTimer);
367
+ }
368
368
 
369
- if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
370
- _.autoPlayTimer = setInterval(_.autoPlayIterator,
371
- _.options.autoplaySpeed);
369
+ if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
370
+ _.autoPlayTimer = setInterval(_.autoPlayIterator,
371
+ _.options.autoplaySpeed);
372
372
  }
373
373
 
374
- };
374
+ };
375
375
 
376
- Slick.prototype.autoPlayClear = function() {
376
+ Slick.prototype.autoPlayClear = function() {
377
377
 
378
378
  var _ = this;
379
379
  if (_.autoPlayTimer) {
380
- clearInterval(_.autoPlayTimer);
380
+ clearInterval(_.autoPlayTimer);
381
381
  }
382
382
 
383
- };
383
+ };
384
384
 
385
- Slick.prototype.autoPlayIterator = function() {
385
+ Slick.prototype.autoPlayIterator = function() {
386
386
 
387
387
  var _ = this;
388
388
 
389
389
  if (_.options.infinite === false) {
390
390
 
391
- if (_.direction === 1) {
391
+ if (_.direction === 1) {
392
392
 
393
- if ((_.currentSlide + 1) === _.slideCount -
394
- 1) {
395
- _.direction = 0;
396
- }
393
+ if ((_.currentSlide + 1) === _.slideCount -
394
+ 1) {
395
+ _.direction = 0;
396
+ }
397
397
 
398
- _.slideHandler(_.currentSlide + _.options.slidesToScroll);
398
+ _.slideHandler(_.currentSlide + _.options.slidesToScroll);
399
399
 
400
400
  } else {
401
401
 
402
- if ((_.currentSlide - 1 === 0)) {
402
+ if ((_.currentSlide - 1 === 0)) {
403
403
 
404
- _.direction = 1;
404
+ _.direction = 1;
405
405
 
406
- }
406
+ }
407
407
 
408
- _.slideHandler(_.currentSlide - _.options.slidesToScroll);
408
+ _.slideHandler(_.currentSlide - _.options.slidesToScroll);
409
409
 
410
410
  }
411
411
 
412
- } else {
412
+ } else {
413
413
 
414
414
  _.slideHandler(_.currentSlide + _.options.slidesToScroll);
415
415
 
416
- }
416
+ }
417
417
 
418
- };
418
+ };
419
419
 
420
- Slick.prototype.buildArrows = function() {
420
+ Slick.prototype.buildArrows = function() {
421
421
 
422
- var _ = this;
422
+ var _ = this;
423
423
 
424
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
424
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
425
425
 
426
426
  _.$prevArrow = $(_.options.prevArrow);
427
427
  _.$nextArrow = $(_.options.nextArrow);
428
428
 
429
429
  if (_.htmlExpr.test(_.options.prevArrow)) {
430
- _.$prevArrow.appendTo(_.options.appendArrows);
430
+ _.$prevArrow.appendTo(_.options.appendArrows);
431
431
  }
432
432
 
433
433
  if (_.htmlExpr.test(_.options.nextArrow)) {
434
- _.$nextArrow.appendTo(_.options.appendArrows);
434
+ _.$nextArrow.appendTo(_.options.appendArrows);
435
435
  }
436
436
 
437
437
  if (_.options.infinite !== true) {
438
- _.$prevArrow.addClass('slick-disabled');
438
+ _.$prevArrow.addClass('slick-disabled');
439
439
  }
440
440
 
441
- }
441
+ }
442
442
 
443
- };
443
+ };
444
444
 
445
- Slick.prototype.buildDots = function() {
445
+ Slick.prototype.buildDots = function() {
446
446
 
447
- var _ = this,
448
- i, dotString;
447
+ var _ = this,
448
+ i, dotString;
449
449
 
450
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
450
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
451
451
 
452
452
  dotString = '<ul class="' + _.options.dotsClass + '">';
453
453
 
454
454
  for (i = 0; i <= _.getDotCount(); i += 1) {
455
- dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
455
+ dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
456
456
  }
457
457
 
458
458
  dotString += '</ul>';
459
459
 
460
460
  _.$dots = $(dotString).appendTo(
461
- _.options.appendDots);
461
+ _.options.appendDots);
462
462
 
463
- _.$dots.find('li').first().addClass('slick-active').attr("aria-hidden","false");
463
+ _.$dots.find('li').first().addClass('slick-active').attr("aria-hidden","false");
464
464
 
465
- }
466
-
467
- };
465
+ }
468
466
 
469
- Slick.prototype.buildOut = function() {
467
+ };
470
468
 
471
- var _ = this;
469
+ Slick.prototype.buildOut = function() {
472
470
 
473
- _.$slides = _.$slider.children(_.options.slide +
474
- ':not(.slick-cloned)').addClass(
475
- 'slick-slide');
476
- _.slideCount = _.$slides.length;
471
+ var _ = this;
477
472
 
478
- _.$slides.each(function(index, element) {
479
- $(element).attr("data-slick-index",index);
480
- });
473
+ _.$slides = _.$slider.children(_.options.slide +
474
+ ':not(.slick-cloned)').addClass(
475
+ 'slick-slide');
476
+ _.slideCount = _.$slides.length;
481
477
 
482
- _.$slidesCache = _.$slides;
478
+ _.$slides.each(function(index, element) {
479
+ $(element).attr("data-slick-index",index);
480
+ });
483
481
 
484
- _.$slider.addClass('slick-slider');
482
+ _.$slidesCache = _.$slides;
485
483
 
486
- _.$slideTrack = (_.slideCount === 0) ?
487
- $('<div class="slick-track"/>').appendTo(_.$slider) :
488
- _.$slides.wrapAll('<div class="slick-track"/>').parent();
484
+ _.$slider.addClass('slick-slider');
489
485
 
490
- _.$list = _.$slideTrack.wrap(
491
- '<div aria-live="polite" class="slick-list"/>').parent();
492
- _.$slideTrack.css('opacity', 0);
486
+ _.$slideTrack = (_.slideCount === 0) ?
487
+ $('<div class="slick-track"/>').appendTo(_.$slider) :
488
+ _.$slides.wrapAll('<div class="slick-track"/>').parent();
493
489
 
494
- if (_.options.centerMode === true) {
495
- _.options.slidesToScroll = 1;
496
- }
490
+ _.$list = _.$slideTrack.wrap(
491
+ '<div aria-live="polite" class="slick-list"/>').parent();
492
+ _.$slideTrack.css('opacity', 0);
497
493
 
498
- $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
494
+ if (_.options.centerMode === true || _.options.swipeToSlide === true) {
495
+ _.options.slidesToScroll = 1;
496
+ }
499
497
 
500
- _.setupInfinite();
498
+ $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
501
499
 
502
- _.buildArrows();
500
+ _.setupInfinite();
503
501
 
504
- _.buildDots();
502
+ _.buildArrows();
505
503
 
506
- _.updateDots();
504
+ _.buildDots();
507
505
 
508
- if (_.options.accessibility === true) {
509
- _.$list.prop('tabIndex', 0);
510
- }
506
+ _.updateDots();
511
507
 
512
- _.setSlideClasses(typeof this.currentSlide === 'number' ? this.currentSlide : 0);
508
+ if (_.options.accessibility === true) {
509
+ _.$list.prop('tabIndex', 0);
510
+ }
513
511
 
514
- if (_.options.draggable === true) {
515
- _.$list.addClass('draggable');
516
- }
512
+ _.setSlideClasses(typeof this.currentSlide === 'number' ? this.currentSlide : 0);
517
513
 
518
- };
514
+ if (_.options.draggable === true) {
515
+ _.$list.addClass('draggable');
516
+ }
519
517
 
520
- Slick.prototype.checkResponsive = function() {
518
+ };
521
519
 
522
- var _ = this,
523
- breakpoint, targetBreakpoint, respondToWidth;
524
- var sliderWidth = _.$slider.width();
525
- var windowWidth = window.innerWidth || $(window).width();
526
- if (_.respondTo === "window") {
527
- respondToWidth = windowWidth;
528
- } else if (_.respondTo === "slider") {
529
- respondToWidth = sliderWidth;
530
- } else if (_.respondTo === "min") {
531
- respondToWidth = Math.min(windowWidth, sliderWidth);
532
- }
520
+ Slick.prototype.checkResponsive = function(initial) {
521
+
522
+ var _ = this,
523
+ breakpoint, targetBreakpoint, respondToWidth;
524
+ var sliderWidth = _.$slider.width();
525
+ var windowWidth = window.innerWidth || $(window).width();
526
+ if (_.respondTo === "window") {
527
+ respondToWidth = windowWidth;
528
+ } else if (_.respondTo === "slider") {
529
+ respondToWidth = sliderWidth;
530
+ } else if (_.respondTo === "min") {
531
+ respondToWidth = Math.min(windowWidth, sliderWidth);
532
+ }
533
533
 
534
- if (_.originalSettings.responsive && _.originalSettings
535
- .responsive.length > -1 && _.originalSettings.responsive !== null) {
534
+ if (_.originalSettings.responsive && _.originalSettings
535
+ .responsive.length > -1 && _.originalSettings.responsive !== null) {
536
536
 
537
- targetBreakpoint = null;
537
+ targetBreakpoint = null;
538
538
 
539
- for (breakpoint in _.breakpoints) {
540
- if (_.breakpoints.hasOwnProperty(breakpoint)) {
541
- if (_.originalSettings.mobileFirst === false) {
542
- if (respondToWidth < _.breakpoints[breakpoint]) {
543
- targetBreakpoint = _.breakpoints[breakpoint];
544
- }
545
- } else {
546
- if (respondToWidth > _.breakpoints[breakpoint]) {
547
- targetBreakpoint = _.breakpoints[breakpoint];
548
- }
549
- }
539
+ for (breakpoint in _.breakpoints) {
540
+ if (_.breakpoints.hasOwnProperty(breakpoint)) {
541
+ if (_.originalSettings.mobileFirst === false) {
542
+ if (respondToWidth < _.breakpoints[breakpoint]) {
543
+ targetBreakpoint = _.breakpoints[breakpoint];
544
+ }
545
+ } else {
546
+ if (respondToWidth > _.breakpoints[breakpoint]) {
547
+ targetBreakpoint = _.breakpoints[breakpoint];
550
548
  }
551
- }
549
+ }
550
+ }
551
+ }
552
552
 
553
- if (targetBreakpoint !== null) {
554
- if (_.activeBreakpoint !== null) {
555
- if (targetBreakpoint !== _.activeBreakpoint) {
556
- _.activeBreakpoint =
553
+ if (targetBreakpoint !== null) {
554
+ if (_.activeBreakpoint !== null) {
555
+ if (targetBreakpoint !== _.activeBreakpoint) {
556
+ _.activeBreakpoint =
557
557
  targetBreakpoint;
558
- if(_.breakpointSettings[targetBreakpoint] === "unslick") {
559
- _.unslick();
560
- } else {
561
- _.options = $.extend({}, _.originalSettings,
562
- _.breakpointSettings[
563
- targetBreakpoint]);
564
- _.refresh();
565
- }
566
- }
567
- } else {
568
- _.activeBreakpoint = targetBreakpoint;
569
- if(_.breakpointSettings[targetBreakpoint] === "unslick") {
570
- _.unslick();
571
- } else {
572
- _.options = $.extend({}, _.originalSettings,
558
+ if(_.breakpointSettings[targetBreakpoint] === "unslick") {
559
+ _.unslick();
560
+ } else {
561
+ _.options = $.extend({}, _.originalSettings,
573
562
  _.breakpointSettings[
563
+ targetBreakpoint]);
564
+ if(initial === true)
565
+ _.currentSlide = _.options.initialSlide;
566
+ _.refresh();
567
+ }
568
+ }
569
+ } else {
570
+ _.activeBreakpoint = targetBreakpoint;
571
+ if(_.breakpointSettings[targetBreakpoint] === "unslick") {
572
+ _.unslick();
573
+ } else {
574
+ _.options = $.extend({}, _.originalSettings,
575
+ _.breakpointSettings[
574
576
  targetBreakpoint]);
575
- _.refresh();
576
- }
577
- }
578
- } else {
579
- if (_.activeBreakpoint !== null) {
580
- _.activeBreakpoint = null;
581
- _.options = _.originalSettings;
582
- _.refresh();
583
- }
584
- }
577
+ if(initial === true)
578
+ _.currentSlide = _.options.initialSlide;
579
+ _.refresh();
580
+ }
581
+ }
582
+ } else {
583
+ if (_.activeBreakpoint !== null) {
584
+ _.activeBreakpoint = null;
585
+ _.options = _.originalSettings;
586
+ if(initial === true)
587
+ _.currentSlide = _.options.initialSlide;
588
+ _.refresh();
589
+ }
590
+ }
585
591
 
586
- }
592
+ }
587
593
 
588
- };
594
+ };
589
595
 
590
- Slick.prototype.changeSlide = function(event, dontAnimate) {
596
+ Slick.prototype.changeSlide = function(event, dontAnimate) {
591
597
 
592
- var _ = this,
593
- $target = $(event.target),
594
- indexOffset, slideOffset, unevenOffset;
598
+ var _ = this,
599
+ $target = $(event.target),
600
+ indexOffset, slideOffset, unevenOffset;
595
601
 
596
- // If target is a link, prevent default action.
597
- $target.is('a') && event.preventDefault();
602
+ // If target is a link, prevent default action.
603
+ $target.is('a') && event.preventDefault();
598
604
 
599
- unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
600
- indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
605
+ unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
606
+ indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
601
607
 
602
- switch (event.data.message) {
608
+ switch (event.data.message) {
603
609
 
604
- case 'previous':
605
- slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
606
- if (_.slideCount > _.options.slidesToShow) {
607
- _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
608
- }
609
- break;
610
+ case 'previous':
611
+ slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
612
+ if (_.slideCount > _.options.slidesToShow) {
613
+ _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
614
+ }
615
+ break;
610
616
 
611
- case 'next':
612
- slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
613
- if (_.slideCount > _.options.slidesToShow) {
614
- _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
615
- }
616
- break;
617
+ case 'next':
618
+ slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
619
+ if (_.slideCount > _.options.slidesToShow) {
620
+ _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
621
+ }
622
+ break;
617
623
 
618
- case 'index':
619
- var index = event.data.index === 0 ? 0 :
620
- event.data.index || $(event.target).parent().index() * _.options.slidesToScroll;
624
+ case 'index':
625
+ var index = event.data.index === 0 ? 0 :
626
+ event.data.index || $(event.target).parent().index() * _.options.slidesToScroll;
621
627
 
622
- _.slideHandler(_.checkNavigable(index), false, dontAnimate);
623
- break;
628
+ _.slideHandler(_.checkNavigable(index), false, dontAnimate);
629
+ break;
624
630
 
625
- default:
626
- return;
627
- }
631
+ default:
632
+ return;
633
+ }
628
634
 
629
- };
635
+ };
630
636
 
631
- Slick.prototype.checkNavigable = function(index) {
637
+ Slick.prototype.checkNavigable = function(index) {
632
638
 
633
- var _ = this, navigables, prevNavigable;
639
+ var _ = this, navigables, prevNavigable;
634
640
 
635
- navigables = _.getNavigableIndexes();
636
- prevNavigable = 0;
637
- if(index > navigables[navigables.length -1]){
638
- index = navigables[navigables.length -1];
639
- } else {
640
- for(var n in navigables) {
641
- if(index < navigables[n]) {
642
- index = prevNavigable;
643
- break;
644
- }
645
- prevNavigable = navigables[n];
646
- }
647
- }
641
+ navigables = _.getNavigableIndexes();
642
+ prevNavigable = 0;
643
+ if(index > navigables[navigables.length -1]){
644
+ index = navigables[navigables.length -1];
645
+ } else {
646
+ for(var n in navigables) {
647
+ if(index < navigables[n]) {
648
+ index = prevNavigable;
649
+ break;
650
+ }
651
+ prevNavigable = navigables[n];
652
+ }
653
+ }
648
654
 
649
- return index;
650
- };
655
+ return index;
656
+ };
651
657
 
652
- Slick.prototype.clickHandler = function(event) {
658
+ Slick.prototype.clickHandler = function(event) {
653
659
 
654
- var _ = this;
660
+ var _ = this;
655
661
 
656
- if(_.shouldClick === false) {
657
- event.stopImmediatePropagation();
658
- event.stopPropagation();
659
- event.preventDefault();
660
- }
662
+ if(_.shouldClick === false) {
663
+ event.stopImmediatePropagation();
664
+ event.stopPropagation();
665
+ event.preventDefault();
666
+ }
661
667
 
662
- };
668
+ };
663
669
 
664
- Slick.prototype.destroy = function() {
670
+ Slick.prototype.destroy = function() {
665
671
 
666
- var _ = this;
672
+ var _ = this;
667
673
 
668
- _.autoPlayClear();
674
+ _.autoPlayClear();
669
675
 
670
- _.touchObject = {};
676
+ _.touchObject = {};
671
677
 
672
- $('.slick-cloned', _.$slider).remove();
673
- if (_.$dots) {
674
- _.$dots.remove();
675
- }
676
- if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) {
677
- _.$prevArrow.remove();
678
- }
679
- if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) {
680
- _.$nextArrow.remove();
681
- }
678
+ $('.slick-cloned', _.$slider).remove();
679
+ if (_.$dots) {
680
+ _.$dots.remove();
681
+ }
682
+ if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) {
683
+ _.$prevArrow.remove();
684
+ }
685
+ if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) {
686
+ _.$nextArrow.remove();
687
+ }
682
688
 
683
689
 
684
- _.$slides.removeClass('slick-slide slick-active slick-center slick-visible')
685
- .attr("aria-hidden","true")
686
- .removeAttr('data-slick-index')
687
- .css({
688
- position: '',
689
- left: '',
690
- top: '',
691
- zIndex: '',
692
- opacity: '',
693
- width: ''
694
- });
690
+ _.$slides.removeClass('slick-slide slick-active slick-center slick-visible')
691
+ .attr("aria-hidden","true")
692
+ .removeAttr('data-slick-index')
693
+ .css({
694
+ position: '',
695
+ left: '',
696
+ top: '',
697
+ zIndex: '',
698
+ opacity: '',
699
+ width: ''
700
+ });
695
701
 
696
- _.$slider.removeClass('slick-slider');
697
- _.$slider.removeClass('slick-initialized');
702
+ _.$slider.removeClass('slick-slider');
703
+ _.$slider.removeClass('slick-initialized');
698
704
 
699
- _.$list.off('.slick');
700
- $(window).off('.slick-' + _.instanceUid);
701
- $(document).off('.slick-' + _.instanceUid);
705
+ _.$list.off('.slick');
706
+ $(window).off('.slick-' + _.instanceUid);
707
+ $(document).off('.slick-' + _.instanceUid);
702
708
 
703
- _.$slider.html(_.$slides);
709
+ _.$slider.html(_.$slides);
704
710
 
705
- };
711
+ };
706
712
 
707
- Slick.prototype.disableTransition = function(slide) {
713
+ Slick.prototype.disableTransition = function(slide) {
708
714
 
709
- var _ = this,
710
- transition = {};
715
+ var _ = this,
716
+ transition = {};
711
717
 
712
- transition[_.transitionType] = "";
718
+ transition[_.transitionType] = "";
713
719
 
714
- if (_.options.fade === false) {
715
- _.$slideTrack.css(transition);
716
- } else {
717
- _.$slides.eq(slide).css(transition);
718
- }
720
+ if (_.options.fade === false) {
721
+ _.$slideTrack.css(transition);
722
+ } else {
723
+ _.$slides.eq(slide).css(transition);
724
+ }
719
725
 
720
- };
726
+ };
721
727
 
722
- Slick.prototype.fadeSlide = function(slideIndex, callback) {
728
+ Slick.prototype.fadeSlide = function(slideIndex, callback) {
723
729
 
724
- var _ = this;
730
+ var _ = this;
725
731
 
726
- if (_.cssTransitions === false) {
732
+ if (_.cssTransitions === false) {
727
733
 
728
- _.$slides.eq(slideIndex).css({
729
- zIndex: 1000
730
- });
734
+ _.$slides.eq(slideIndex).css({
735
+ zIndex: 1000
736
+ });
731
737
 
732
- _.$slides.eq(slideIndex).animate({
733
- opacity: 1
734
- }, _.options.speed, _.options.easing, callback);
738
+ _.$slides.eq(slideIndex).animate({
739
+ opacity: 1
740
+ }, _.options.speed, _.options.easing, callback);
735
741
 
736
- } else {
742
+ } else {
737
743
 
738
- _.applyTransition(slideIndex);
744
+ _.applyTransition(slideIndex);
739
745
 
740
- _.$slides.eq(slideIndex).css({
741
- opacity: 1,
742
- zIndex: 1000
743
- });
746
+ _.$slides.eq(slideIndex).css({
747
+ opacity: 1,
748
+ zIndex: 1000
749
+ });
744
750
 
745
- if (callback) {
746
- setTimeout(function() {
751
+ if (callback) {
752
+ setTimeout(function() {
747
753
 
748
- _.disableTransition(slideIndex);
754
+ _.disableTransition(slideIndex);
749
755
 
750
- callback.call();
751
- }, _.options.speed);
752
- }
756
+ callback.call();
757
+ }, _.options.speed);
758
+ }
753
759
 
754
- }
760
+ }
755
761
 
756
- };
762
+ };
757
763
 
758
- Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
764
+ Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
759
765
 
760
- var _ = this;
766
+ var _ = this;
761
767
 
762
- if (filter !== null) {
768
+ if (filter !== null) {
763
769
 
764
- _.unload();
770
+ _.unload();
765
771
 
766
- _.$slideTrack.children(this.options.slide).detach();
772
+ _.$slideTrack.children(this.options.slide).detach();
767
773
 
768
- _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
774
+ _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
769
775
 
770
- _.reinit();
776
+ _.reinit();
771
777
 
772
- }
778
+ }
773
779
 
774
- };
780
+ };
775
781
 
776
- Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
782
+ Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
777
783
 
778
- var _ = this;
779
- return _.currentSlide;
784
+ var _ = this;
785
+ return _.currentSlide;
780
786
 
781
- };
787
+ };
782
788
 
783
- Slick.prototype.getDotCount = function() {
789
+ Slick.prototype.getDotCount = function() {
784
790
 
785
- var _ = this;
791
+ var _ = this;
786
792
 
787
- var breakPoint = 0;
788
- var counter = 0;
789
- var pagerQty = 0;
793
+ var breakPoint = 0;
794
+ var counter = 0;
795
+ var pagerQty = 0;
790
796
 
791
- if(_.options.infinite === true) {
792
- pagerQty = Math.ceil(_.slideCount / _.options.slidesToScroll);
793
- } else if (_.options.centerMode === true) {
794
- pagerQty = _.slideCount;
795
- } else {
796
- while (breakPoint < _.slideCount){
797
- ++pagerQty;
798
- breakPoint = counter + _.options.slidesToShow;
799
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
800
- }
801
- }
797
+ if(_.options.infinite === true) {
798
+ pagerQty = Math.ceil(_.slideCount / _.options.slidesToScroll);
799
+ } else if (_.options.centerMode === true) {
800
+ pagerQty = _.slideCount;
801
+ } else {
802
+ while (breakPoint < _.slideCount){
803
+ ++pagerQty;
804
+ breakPoint = counter + _.options.slidesToShow;
805
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
806
+ }
807
+ }
802
808
 
803
- return pagerQty - 1;
809
+ return pagerQty - 1;
804
810
 
805
- };
811
+ };
806
812
 
807
- Slick.prototype.getLeft = function(slideIndex) {
813
+ Slick.prototype.getLeft = function(slideIndex) {
808
814
 
809
- var _ = this,
810
- targetLeft,
811
- verticalHeight,
812
- verticalOffset = 0,
813
- targetSlide;
815
+ var _ = this,
816
+ targetLeft,
817
+ verticalHeight,
818
+ verticalOffset = 0,
819
+ targetSlide;
814
820
 
815
- _.slideOffset = 0;
816
- verticalHeight = _.$slides.first().outerHeight();
821
+ _.slideOffset = 0;
822
+ verticalHeight = _.$slides.first().outerHeight();
817
823
 
818
- if (_.options.infinite === true) {
819
- if (_.slideCount > _.options.slidesToShow) {
820
- _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
821
- verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
822
- }
823
- if (_.slideCount % _.options.slidesToScroll !== 0) {
824
- if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
825
- if(slideIndex > _.slideCount) {
826
- _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
827
- verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
828
- } else {
829
- _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
830
- verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
831
- }
832
- }
833
- }
834
- } else {
835
- if(slideIndex + _.options.slidesToShow > _.slideCount) {
836
- _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
837
- verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
838
- }
839
- }
824
+ if (_.options.infinite === true) {
825
+ if (_.slideCount > _.options.slidesToShow) {
826
+ _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
827
+ verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
828
+ }
829
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
830
+ if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
831
+ if(slideIndex > _.slideCount) {
832
+ _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
833
+ verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
834
+ } else {
835
+ _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
836
+ verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
837
+ }
838
+ }
839
+ }
840
+ } else {
841
+ if(slideIndex + _.options.slidesToShow > _.slideCount) {
842
+ _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
843
+ verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
844
+ }
845
+ }
840
846
 
841
- if (_.slideCount <= _.options.slidesToShow){
842
- _.slideOffset = 0;
843
- verticalOffset = 0;
844
- }
847
+ if (_.slideCount <= _.options.slidesToShow){
848
+ _.slideOffset = 0;
849
+ verticalOffset = 0;
850
+ }
845
851
 
846
- if (_.options.centerMode === true && _.options.infinite === true) {
847
- _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
848
- } else if (_.options.centerMode === true) {
849
- _.slideOffset = 0;
850
- _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
851
- }
852
+ if (_.options.centerMode === true && _.options.infinite === true) {
853
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
854
+ } else if (_.options.centerMode === true) {
855
+ _.slideOffset = 0;
856
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
857
+ }
852
858
 
853
- if (_.options.vertical === false) {
854
- targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
855
- } else {
856
- targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
857
- }
859
+ if (_.options.vertical === false) {
860
+ targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
861
+ } else {
862
+ targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
863
+ }
858
864
 
859
- if (_.options.variableWidth === true) {
865
+ if (_.options.variableWidth === true) {
860
866
 
861
- if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
862
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
863
- } else {
864
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
865
- }
867
+ if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
868
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
869
+ } else {
870
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
871
+ }
866
872
 
867
- targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
873
+ targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
868
874
 
869
- if (_.options.centerMode === true) {
870
- if(_.options.infinite === false) {
871
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
872
- } else {
873
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
874
- }
875
- targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
876
- targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
877
- }
878
- }
875
+ if (_.options.centerMode === true) {
876
+ if(_.options.infinite === false) {
877
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
878
+ } else {
879
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
880
+ }
881
+ targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
882
+ targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
883
+ }
884
+ }
879
885
 
880
- return targetLeft;
886
+ return targetLeft;
881
887
 
882
- };
888
+ };
883
889
 
884
- Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
890
+ Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
885
891
 
886
- var _ = this;
892
+ var _ = this;
887
893
 
888
- return _.options[option];
894
+ return _.options[option];
889
895
 
890
- };
896
+ };
891
897
 
892
- Slick.prototype.getNavigableIndexes = function() {
898
+ Slick.prototype.getNavigableIndexes = function() {
893
899
 
894
- var _ = this;
900
+ var _ = this, breakPoint = 0, counter = 0, indexes = [], max;
895
901
 
896
- var breakPoint = 0;
897
- var counter = 0;
898
- var indexes = [];
899
- var max = _.options.infinite === false ? _.slideCount - _.options.slidesToShow + 1 : _.slideCount;
900
- if (_.options.centerMode === true) max = _.slideCount;
902
+ if(_.options.infinite === false) {
903
+ max = _.slideCount - _.options.slidesToShow + 1;
904
+ if (_.options.centerMode === true) max = _.slideCount;
905
+ } else {
906
+ breakPoint = _.slideCount * -1;
907
+ counter = _.slideCount * -1;
908
+ max = _.slideCount * 2;
909
+ }
901
910
 
902
- while (breakPoint < max){
903
- indexes.push(breakPoint);
904
- breakPoint = counter + _.options.slidesToScroll;
905
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
906
- }
911
+ while (breakPoint < max){
912
+ indexes.push(breakPoint);
913
+ breakPoint = counter + _.options.slidesToScroll;
914
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
915
+ }
907
916
 
908
- return indexes;
917
+ return indexes;
909
918
 
910
- };
919
+ };
911
920
 
912
- Slick.prototype.getSlick = function() {
921
+ Slick.prototype.getSlick = function() {
913
922
 
914
- return this;
923
+ return this;
915
924
 
916
- };
925
+ };
917
926
 
918
- Slick.prototype.getSlideCount = function() {
927
+ Slick.prototype.getSlideCount = function() {
919
928
 
920
- var _ = this, slidesTraversed, swipedSlide, centerOffset;
929
+ var _ = this, slidesTraversed, swipedSlide, centerOffset;
921
930
 
922
- centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
931
+ centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
923
932
 
924
- if(_.options.swipeToSlide === true) {
925
- _.$slideTrack.find('.slick-slide').each(function(index, slide){
926
- if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
927
- swipedSlide = slide;
928
- return false;
929
- }
930
- });
933
+ if(_.options.swipeToSlide === true) {
934
+ _.$slideTrack.find('.slick-slide').each(function(index, slide){
935
+ if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
936
+ swipedSlide = slide;
937
+ return false;
938
+ }
939
+ });
931
940
 
932
- slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
941
+ slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
933
942
 
934
- return slidesTraversed;
943
+ return slidesTraversed;
935
944
 
936
- } else {
937
- return _.options.slidesToScroll;
938
- }
945
+ } else {
946
+ return _.options.slidesToScroll;
947
+ }
939
948
 
940
- };
949
+ };
941
950
 
942
- Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
951
+ Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
943
952
 
944
- var _ = this;
953
+ var _ = this;
945
954
 
946
- _.changeSlide({
947
- data: {
948
- message: 'index',
949
- index: parseInt(slide)
950
- }
951
- }, dontAnimate);
955
+ _.changeSlide({
956
+ data: {
957
+ message: 'index',
958
+ index: parseInt(slide)
959
+ }
960
+ }, dontAnimate);
952
961
 
953
- };
962
+ };
954
963
 
955
- Slick.prototype.init = function() {
964
+ Slick.prototype.init = function() {
956
965
 
957
- var _ = this;
966
+ var _ = this;
958
967
 
959
- if (!$(_.$slider).hasClass('slick-initialized')) {
968
+ if (!$(_.$slider).hasClass('slick-initialized')) {
960
969
 
961
- $(_.$slider).addClass('slick-initialized');
962
- _.buildOut();
963
- _.setProps();
964
- _.startLoad();
965
- _.loadSlider();
966
- _.initializeEvents();
967
- _.updateArrows();
968
- _.updateDots();
969
- }
970
+ $(_.$slider).addClass('slick-initialized');
971
+ _.buildOut();
972
+ _.setProps();
973
+ _.startLoad();
974
+ _.loadSlider();
975
+ _.initializeEvents();
976
+ _.updateArrows();
977
+ _.updateDots();
978
+ }
970
979
 
971
- _.$slider.trigger("init", [ _ ]);
980
+ _.$slider.trigger("init", [ _ ]);
972
981
 
973
- };
982
+ };
974
983
 
975
- Slick.prototype.initArrowEvents = function() {
984
+ Slick.prototype.initArrowEvents = function() {
976
985
 
977
- var _ = this;
986
+ var _ = this;
978
987
 
979
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
980
- _.$prevArrow.on('click.slick', {
981
- message: 'previous'
982
- }, _.changeSlide);
983
- _.$nextArrow.on('click.slick', {
984
- message: 'next'
985
- }, _.changeSlide);
986
- }
988
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
989
+ _.$prevArrow.on('click.slick', {
990
+ message: 'previous'
991
+ }, _.changeSlide);
992
+ _.$nextArrow.on('click.slick', {
993
+ message: 'next'
994
+ }, _.changeSlide);
995
+ }
987
996
 
988
- };
997
+ };
989
998
 
990
- Slick.prototype.initDotEvents = function() {
999
+ Slick.prototype.initDotEvents = function() {
991
1000
 
992
- var _ = this;
1001
+ var _ = this;
993
1002
 
994
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
995
- $('li', _.$dots).on('click.slick', {
996
- message: 'index'
997
- }, _.changeSlide);
998
- }
1003
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1004
+ $('li', _.$dots).on('click.slick', {
1005
+ message: 'index'
1006
+ }, _.changeSlide);
1007
+ }
999
1008
 
1000
- if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
1001
- $('li', _.$dots)
1002
- .on('mouseenter.slick', function(){
1003
- _.paused = true;
1004
- _.autoPlayClear();
1005
- })
1006
- .on('mouseleave.slick', function(){
1007
- _.paused = false;
1008
- _.autoPlay();
1009
- });
1010
- }
1009
+ if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
1010
+ $('li', _.$dots)
1011
+ .on('mouseenter.slick', function(){
1012
+ _.paused = true;
1013
+ _.autoPlayClear();
1014
+ })
1015
+ .on('mouseleave.slick', function(){
1016
+ _.paused = false;
1017
+ _.autoPlay();
1018
+ });
1019
+ }
1011
1020
 
1012
- };
1021
+ };
1013
1022
 
1014
- Slick.prototype.initializeEvents = function() {
1023
+ Slick.prototype.initializeEvents = function() {
1015
1024
 
1016
- var _ = this;
1025
+ var _ = this;
1017
1026
 
1018
- _.initArrowEvents();
1027
+ _.initArrowEvents();
1019
1028
 
1020
- _.initDotEvents();
1029
+ _.initDotEvents();
1021
1030
 
1022
- _.$list.on('touchstart.slick mousedown.slick', {
1023
- action: 'start'
1024
- }, _.swipeHandler);
1025
- _.$list.on('touchmove.slick mousemove.slick', {
1026
- action: 'move'
1027
- }, _.swipeHandler);
1028
- _.$list.on('touchend.slick mouseup.slick', {
1029
- action: 'end'
1030
- }, _.swipeHandler);
1031
- _.$list.on('touchcancel.slick mouseleave.slick', {
1032
- action: 'end'
1033
- }, _.swipeHandler);
1031
+ _.$list.on('touchstart.slick mousedown.slick', {
1032
+ action: 'start'
1033
+ }, _.swipeHandler);
1034
+ _.$list.on('touchmove.slick mousemove.slick', {
1035
+ action: 'move'
1036
+ }, _.swipeHandler);
1037
+ _.$list.on('touchend.slick mouseup.slick', {
1038
+ action: 'end'
1039
+ }, _.swipeHandler);
1040
+ _.$list.on('touchcancel.slick mouseleave.slick', {
1041
+ action: 'end'
1042
+ }, _.swipeHandler);
1034
1043
 
1035
- _.$list.on('click.slick', _.clickHandler);
1044
+ _.$list.on('click.slick', _.clickHandler);
1036
1045
 
1037
- if (_.options.autoplay === true) {
1046
+ if (_.options.autoplay === true) {
1038
1047
 
1039
- $(document).on(_.visibilityChange, function(){
1040
- _.visibility();
1041
- });
1048
+ $(document).on(_.visibilityChange, function(){
1049
+ _.visibility();
1050
+ });
1042
1051
 
1043
- if( _.options.pauseOnHover === true ) {
1052
+ if( _.options.pauseOnHover === true ) {
1044
1053
 
1045
- _.$list.on('mouseenter.slick', function(){
1046
- _.paused = true;
1047
- _.autoPlayClear();
1048
- });
1049
- _.$list.on('mouseleave.slick', function(){
1050
- _.paused = false;
1051
- _.autoPlay();
1052
- });
1054
+ _.$list.on('mouseenter.slick', function(){
1055
+ _.paused = true;
1056
+ _.autoPlayClear();
1057
+ });
1058
+ _.$list.on('mouseleave.slick', function(){
1059
+ _.paused = false;
1060
+ _.autoPlay();
1061
+ });
1053
1062
 
1054
- }
1063
+ }
1055
1064
 
1056
- }
1065
+ }
1057
1066
 
1058
- if(_.options.accessibility === true) {
1059
- _.$list.on('keydown.slick', _.keyHandler);
1060
- }
1067
+ if(_.options.accessibility === true) {
1068
+ _.$list.on('keydown.slick', _.keyHandler);
1069
+ }
1061
1070
 
1062
- if(_.options.focusOnSelect === true) {
1063
- $(_.options.slide, _.$slideTrack).on('click.slick', _.selectHandler);
1064
- }
1071
+ if(_.options.focusOnSelect === true) {
1072
+ $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1073
+ }
1065
1074
 
1066
- $(window).on('orientationchange.slick.slick-' + _.instanceUid, function() {
1067
- _.checkResponsive();
1068
- _.setPosition();
1069
- });
1075
+ $(window).on('orientationchange.slick.slick-' + _.instanceUid, function() {
1076
+ _.checkResponsive();
1077
+ _.setPosition();
1078
+ });
1079
+
1080
+ $(window).on('resize.slick.slick-' + _.instanceUid, function() {
1081
+ if ($(window).width() !== _.windowWidth) {
1082
+ clearTimeout(_.windowDelay);
1083
+ _.windowDelay = window.setTimeout(function() {
1084
+ _.windowWidth = $(window).width();
1085
+ _.checkResponsive();
1086
+ _.setPosition();
1087
+ }, 50);
1088
+ }
1089
+ });
1070
1090
 
1071
- $(window).on('resize.slick.slick-' + _.instanceUid, function() {
1072
- if ($(window).width() !== _.windowWidth) {
1073
- clearTimeout(_.windowDelay);
1074
- _.windowDelay = window.setTimeout(function() {
1075
- _.windowWidth = $(window).width();
1076
- _.checkResponsive();
1077
- _.setPosition();
1078
- }, 50);
1079
- }
1080
- });
1081
-
1082
- $('*[draggable!=true]', _.$slideTrack).on('dragstart', function(e){ e.preventDefault(); });
1083
-
1084
- $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1085
- $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
1091
+ $('*[draggable!=true]', _.$slideTrack).on('dragstart', function(e){ e.preventDefault(); });
1086
1092
 
1087
- };
1093
+ $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1094
+ $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
1088
1095
 
1089
- Slick.prototype.initUI = function() {
1096
+ };
1090
1097
 
1091
- var _ = this;
1098
+ Slick.prototype.initUI = function() {
1092
1099
 
1093
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1094
-
1095
- _.$prevArrow.show();
1096
- _.$nextArrow.show();
1100
+ var _ = this;
1097
1101
 
1098
- }
1102
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1099
1103
 
1100
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1104
+ _.$prevArrow.show();
1105
+ _.$nextArrow.show();
1101
1106
 
1102
- _.$dots.show();
1107
+ }
1103
1108
 
1104
- }
1109
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1105
1110
 
1106
- if (_.options.autoplay === true) {
1111
+ _.$dots.show();
1107
1112
 
1108
- _.autoPlay();
1113
+ }
1109
1114
 
1110
- }
1115
+ if (_.options.autoplay === true) {
1111
1116
 
1112
- };
1117
+ _.autoPlay();
1113
1118
 
1114
- Slick.prototype.keyHandler = function(event) {
1119
+ }
1115
1120
 
1116
- var _ = this;
1121
+ };
1117
1122
 
1118
- if (event.keyCode === 37 && _.options.accessibility === true) {
1119
- _.changeSlide({
1120
- data: {
1121
- message: 'previous'
1122
- }
1123
- });
1124
- } else if (event.keyCode === 39 && _.options.accessibility === true) {
1125
- _.changeSlide({
1126
- data: {
1127
- message: 'next'
1128
- }
1129
- });
1130
- }
1123
+ Slick.prototype.keyHandler = function(event) {
1131
1124
 
1132
- };
1125
+ var _ = this;
1133
1126
 
1134
- Slick.prototype.lazyLoad = function() {
1127
+ if (event.keyCode === 37 && _.options.accessibility === true) {
1128
+ _.changeSlide({
1129
+ data: {
1130
+ message: 'previous'
1131
+ }
1132
+ });
1133
+ } else if (event.keyCode === 39 && _.options.accessibility === true) {
1134
+ _.changeSlide({
1135
+ data: {
1136
+ message: 'next'
1137
+ }
1138
+ });
1139
+ }
1135
1140
 
1136
- var _ = this,
1137
- loadRange, cloneRange, rangeStart, rangeEnd;
1141
+ };
1138
1142
 
1139
- function loadImages(imagesScope) {
1140
- $('img[data-lazy]', imagesScope).each(function() {
1141
- var image = $(this),
1142
- imageSource = $(this).attr('data-lazy');
1143
+ Slick.prototype.lazyLoad = function() {
1143
1144
 
1144
- image
1145
- .load(function() { image.animate({ opacity: 1 }, 200); })
1146
- .css({ opacity: 0 })
1147
- .attr('src', imageSource)
1148
- .removeAttr('data-lazy')
1149
- .removeClass('slick-loading');
1150
- });
1151
- }
1145
+ var _ = this,
1146
+ loadRange, cloneRange, rangeStart, rangeEnd;
1152
1147
 
1153
- if (_.options.centerMode === true) {
1154
- if (_.options.infinite === true) {
1155
- rangeStart = _.currentSlide + (_.options.slidesToShow/2 + 1);
1156
- rangeEnd = rangeStart + _.options.slidesToShow + 2;
1157
- } else {
1158
- rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow/2 + 1));
1159
- rangeEnd = 2 + (_.options.slidesToShow/2 + 1) + _.currentSlide;
1160
- }
1161
- } else {
1162
- rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1163
- rangeEnd = rangeStart + _.options.slidesToShow;
1164
- if (_.options.fade === true ) {
1165
- if(rangeStart > 0) rangeStart--;
1166
- if(rangeEnd <= _.slideCount) rangeEnd++;
1167
- }
1168
- }
1148
+ function loadImages(imagesScope) {
1149
+ $('img[data-lazy]', imagesScope).each(function() {
1150
+ var image = $(this),
1151
+ imageSource = $(this).attr('data-lazy');
1169
1152
 
1170
- loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1171
- loadImages(loadRange);
1153
+ image
1154
+ .load(function() { image.animate({ opacity: 1 }, 200); })
1155
+ .css({ opacity: 0 })
1156
+ .attr('src', imageSource)
1157
+ .removeAttr('data-lazy')
1158
+ .removeClass('slick-loading');
1159
+ });
1160
+ }
1172
1161
 
1173
- if (_.slideCount <= _.options.slidesToShow){
1174
- cloneRange = _.$slider.find('.slick-slide');
1175
- loadImages(cloneRange);
1176
- }else
1177
- if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1178
- cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1179
- loadImages(cloneRange);
1180
- } else if (_.currentSlide === 0) {
1181
- cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1182
- loadImages(cloneRange);
1183
- }
1162
+ if (_.options.centerMode === true) {
1163
+ if (_.options.infinite === true) {
1164
+ rangeStart = _.currentSlide + (_.options.slidesToShow/2 + 1);
1165
+ rangeEnd = rangeStart + _.options.slidesToShow + 2;
1166
+ } else {
1167
+ rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow/2 + 1));
1168
+ rangeEnd = 2 + (_.options.slidesToShow/2 + 1) + _.currentSlide;
1169
+ }
1170
+ } else {
1171
+ rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1172
+ rangeEnd = rangeStart + _.options.slidesToShow;
1173
+ if (_.options.fade === true ) {
1174
+ if(rangeStart > 0) rangeStart--;
1175
+ if(rangeEnd <= _.slideCount) rangeEnd++;
1176
+ }
1177
+ }
1184
1178
 
1185
- };
1179
+ loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1180
+ loadImages(loadRange);
1181
+
1182
+ if (_.slideCount <= _.options.slidesToShow){
1183
+ cloneRange = _.$slider.find('.slick-slide');
1184
+ loadImages(cloneRange);
1185
+ }else
1186
+ if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1187
+ cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1188
+ loadImages(cloneRange);
1189
+ } else if (_.currentSlide === 0) {
1190
+ cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1191
+ loadImages(cloneRange);
1192
+ }
1186
1193
 
1187
- Slick.prototype.loadSlider = function() {
1194
+ };
1188
1195
 
1189
- var _ = this;
1196
+ Slick.prototype.loadSlider = function() {
1190
1197
 
1191
- _.setPosition();
1198
+ var _ = this;
1192
1199
 
1193
- _.$slideTrack.css({
1194
- opacity: 1
1195
- });
1200
+ _.setPosition();
1196
1201
 
1197
- _.$slider.removeClass('slick-loading');
1202
+ _.$slideTrack.css({
1203
+ opacity: 1
1204
+ });
1198
1205
 
1199
- _.initUI();
1206
+ _.$slider.removeClass('slick-loading');
1200
1207
 
1201
- if (_.options.lazyLoad === 'progressive') {
1202
- _.progressiveLazyLoad();
1203
- }
1208
+ _.initUI();
1204
1209
 
1205
- };
1210
+ if (_.options.lazyLoad === 'progressive') {
1211
+ _.progressiveLazyLoad();
1212
+ }
1206
1213
 
1207
- Slick.prototype.next = Slick.prototype.slickNext = function() {
1214
+ };
1208
1215
 
1209
- var _ = this;
1216
+ Slick.prototype.next = Slick.prototype.slickNext = function() {
1210
1217
 
1211
- _.changeSlide({
1212
- data: {
1213
- message: 'next'
1214
- }
1215
- });
1218
+ var _ = this;
1216
1219
 
1217
- };
1220
+ _.changeSlide({
1221
+ data: {
1222
+ message: 'next'
1223
+ }
1224
+ });
1218
1225
 
1219
- Slick.prototype.pause = Slick.prototype.slickPause = function() {
1226
+ };
1220
1227
 
1221
- var _ = this;
1228
+ Slick.prototype.pause = Slick.prototype.slickPause = function() {
1222
1229
 
1223
- _.autoPlayClear();
1224
- _.paused = true;
1230
+ var _ = this;
1225
1231
 
1226
- };
1232
+ _.autoPlayClear();
1233
+ _.paused = true;
1227
1234
 
1228
- Slick.prototype.play = Slick.prototype.slickPlay = function() {
1235
+ };
1229
1236
 
1230
- var _ = this;
1237
+ Slick.prototype.play = Slick.prototype.slickPlay = function() {
1231
1238
 
1232
- _.paused = false;
1233
- _.autoPlay();
1239
+ var _ = this;
1234
1240
 
1235
- };
1241
+ _.paused = false;
1242
+ _.autoPlay();
1236
1243
 
1237
- Slick.prototype.postSlide = function(index) {
1244
+ };
1238
1245
 
1239
- var _ = this;
1246
+ Slick.prototype.postSlide = function(index) {
1240
1247
 
1241
- _.$slider.trigger("afterChange", [ _, index]);
1248
+ var _ = this;
1242
1249
 
1243
- _.animating = false;
1250
+ _.$slider.trigger("afterChange", [ _, index]);
1244
1251
 
1245
- _.setPosition();
1252
+ _.animating = false;
1246
1253
 
1247
- _.swipeLeft = null;
1254
+ _.setPosition();
1248
1255
 
1249
- if (_.options.autoplay === true && _.paused === false) {
1250
- _.autoPlay();
1251
- }
1256
+ _.swipeLeft = null;
1252
1257
 
1253
- };
1258
+ if (_.options.autoplay === true && _.paused === false) {
1259
+ _.autoPlay();
1260
+ }
1254
1261
 
1255
- Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1262
+ };
1256
1263
 
1257
- var _ = this;
1264
+ Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1258
1265
 
1259
- _.changeSlide({
1260
- data: {
1261
- message: 'previous'
1262
- }
1263
- });
1266
+ var _ = this;
1264
1267
 
1265
- };
1268
+ _.changeSlide({
1269
+ data: {
1270
+ message: 'previous'
1271
+ }
1272
+ });
1266
1273
 
1267
- Slick.prototype.progressiveLazyLoad = function() {
1274
+ };
1268
1275
 
1269
- var _ = this,
1270
- imgCount, targetImage;
1276
+ Slick.prototype.progressiveLazyLoad = function() {
1271
1277
 
1272
- imgCount = $('img[data-lazy]', _.$slider).length;
1278
+ var _ = this,
1279
+ imgCount, targetImage;
1273
1280
 
1274
- if (imgCount > 0) {
1275
- targetImage = $('img[data-lazy]', _.$slider).first();
1276
- targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
1277
- targetImage.removeAttr('data-lazy');
1278
- _.progressiveLazyLoad();
1281
+ imgCount = $('img[data-lazy]', _.$slider).length;
1279
1282
 
1280
- if( _.options.adaptiveHeight === true ) {
1281
- _.setPosition();
1282
- }
1283
- })
1284
- .error(function () {
1285
- targetImage.removeAttr('data-lazy');
1286
- _.progressiveLazyLoad();
1287
- });
1288
- }
1283
+ if (imgCount > 0) {
1284
+ targetImage = $('img[data-lazy]', _.$slider).first();
1285
+ targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
1286
+ targetImage.removeAttr('data-lazy');
1287
+ _.progressiveLazyLoad();
1289
1288
 
1290
- };
1289
+ if( _.options.adaptiveHeight === true ) {
1290
+ _.setPosition();
1291
+ }
1292
+ })
1293
+ .error(function () {
1294
+ targetImage.removeAttr('data-lazy');
1295
+ _.progressiveLazyLoad();
1296
+ });
1297
+ }
1291
1298
 
1292
- Slick.prototype.refresh = function() {
1299
+ };
1293
1300
 
1294
- var _ = this,
1295
- currentSlide = _.currentSlide;
1301
+ Slick.prototype.refresh = function() {
1296
1302
 
1297
- _.destroy();
1303
+ var _ = this,
1304
+ currentSlide = _.currentSlide;
1298
1305
 
1299
- $.extend(_, _.initials);
1306
+ _.destroy();
1300
1307
 
1301
- _.init();
1308
+ $.extend(_, _.initials);
1302
1309
 
1303
- _.changeSlide({
1304
- data: {
1305
- message: 'index',
1306
- index: currentSlide
1307
- }
1308
- }, true);
1310
+ _.init();
1309
1311
 
1310
- };
1312
+ _.changeSlide({
1313
+ data: {
1314
+ message: 'index',
1315
+ index: currentSlide
1316
+ }
1317
+ }, true);
1311
1318
 
1312
- Slick.prototype.reinit = function() {
1319
+ };
1313
1320
 
1314
- var _ = this;
1321
+ Slick.prototype.reinit = function() {
1315
1322
 
1316
- _.$slides = _.$slideTrack.children(_.options.slide).addClass(
1317
- 'slick-slide');
1323
+ var _ = this;
1318
1324
 
1319
- _.slideCount = _.$slides.length;
1325
+ _.$slides = _.$slideTrack.children(_.options.slide).addClass(
1326
+ 'slick-slide');
1320
1327
 
1321
- if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1322
- _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1323
- }
1328
+ _.slideCount = _.$slides.length;
1324
1329
 
1325
- if (_.slideCount <= _.options.slidesToShow) {
1326
- _.currentSlide = 0;
1327
- }
1330
+ if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1331
+ _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1332
+ }
1328
1333
 
1329
- _.setProps();
1334
+ if (_.slideCount <= _.options.slidesToShow) {
1335
+ _.currentSlide = 0;
1336
+ }
1330
1337
 
1331
- _.setupInfinite();
1338
+ _.setProps();
1332
1339
 
1333
- _.buildArrows();
1340
+ _.setupInfinite();
1334
1341
 
1335
- _.updateArrows();
1342
+ _.buildArrows();
1336
1343
 
1337
- _.initArrowEvents();
1344
+ _.updateArrows();
1338
1345
 
1339
- _.buildDots();
1346
+ _.initArrowEvents();
1340
1347
 
1341
- _.updateDots();
1348
+ _.buildDots();
1342
1349
 
1343
- _.initDotEvents();
1350
+ _.updateDots();
1344
1351
 
1345
- if(_.options.focusOnSelect === true) {
1346
- $(_.options.slide, _.$slideTrack).on('click.slick', _.selectHandler);
1347
- }
1352
+ _.initDotEvents();
1348
1353
 
1349
- _.setSlideClasses(0);
1354
+ if(_.options.focusOnSelect === true) {
1355
+ $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1356
+ }
1350
1357
 
1351
- _.setPosition();
1358
+ _.setSlideClasses(0);
1352
1359
 
1353
- _.$slider.trigger("reInit", [ _ ]);
1360
+ _.setPosition();
1354
1361
 
1355
- };
1362
+ _.$slider.trigger("reInit", [ _ ]);
1356
1363
 
1357
- Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1364
+ };
1358
1365
 
1359
- var _ = this;
1366
+ Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1360
1367
 
1361
- if (typeof(index) === 'boolean') {
1362
- removeBefore = index;
1363
- index = removeBefore === true ? 0 : _.slideCount - 1;
1364
- } else {
1365
- index = removeBefore === true ? --index : index;
1366
- }
1368
+ var _ = this;
1367
1369
 
1368
- if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1369
- return false;
1370
- }
1370
+ if (typeof(index) === 'boolean') {
1371
+ removeBefore = index;
1372
+ index = removeBefore === true ? 0 : _.slideCount - 1;
1373
+ } else {
1374
+ index = removeBefore === true ? --index : index;
1375
+ }
1371
1376
 
1372
- _.unload();
1377
+ if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1378
+ return false;
1379
+ }
1373
1380
 
1374
- if(removeAll === true) {
1375
- _.$slideTrack.children().remove();
1376
- } else {
1377
- _.$slideTrack.children(this.options.slide).eq(index).remove();
1378
- }
1381
+ _.unload();
1379
1382
 
1380
- _.$slides = _.$slideTrack.children(this.options.slide);
1383
+ if(removeAll === true) {
1384
+ _.$slideTrack.children().remove();
1385
+ } else {
1386
+ _.$slideTrack.children(this.options.slide).eq(index).remove();
1387
+ }
1381
1388
 
1382
- _.$slideTrack.children(this.options.slide).detach();
1389
+ _.$slides = _.$slideTrack.children(this.options.slide);
1383
1390
 
1384
- _.$slideTrack.append(_.$slides);
1391
+ _.$slideTrack.children(this.options.slide).detach();
1385
1392
 
1386
- _.$slidesCache = _.$slides;
1393
+ _.$slideTrack.append(_.$slides);
1387
1394
 
1388
- _.reinit();
1395
+ _.$slidesCache = _.$slides;
1389
1396
 
1390
- };
1397
+ _.reinit();
1391
1398
 
1392
- Slick.prototype.setCSS = function(position) {
1399
+ };
1393
1400
 
1394
- var _ = this,
1395
- positionProps = {}, x, y;
1401
+ Slick.prototype.setCSS = function(position) {
1396
1402
 
1397
- if (_.options.rtl === true) {
1398
- position = -position;
1399
- }
1400
- x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
1401
- y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
1403
+ var _ = this,
1404
+ positionProps = {}, x, y;
1402
1405
 
1403
- positionProps[_.positionProp] = position;
1406
+ if (_.options.rtl === true) {
1407
+ position = -position;
1408
+ }
1409
+ x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
1410
+ y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
1404
1411
 
1405
- if (_.transformsEnabled === false) {
1406
- _.$slideTrack.css(positionProps);
1407
- } else {
1408
- positionProps = {};
1409
- if (_.cssTransitions === false) {
1410
- positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
1411
- _.$slideTrack.css(positionProps);
1412
- } else {
1413
- positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
1414
- _.$slideTrack.css(positionProps);
1415
- }
1416
- }
1412
+ positionProps[_.positionProp] = position;
1417
1413
 
1418
- };
1414
+ if (_.transformsEnabled === false) {
1415
+ _.$slideTrack.css(positionProps);
1416
+ } else {
1417
+ positionProps = {};
1418
+ if (_.cssTransitions === false) {
1419
+ positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
1420
+ _.$slideTrack.css(positionProps);
1421
+ } else {
1422
+ positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
1423
+ _.$slideTrack.css(positionProps);
1424
+ }
1425
+ }
1419
1426
 
1420
- Slick.prototype.setDimensions = function() {
1427
+ };
1421
1428
 
1422
- var _ = this;
1429
+ Slick.prototype.setDimensions = function() {
1423
1430
 
1424
- if (_.options.vertical === false) {
1425
- if (_.options.centerMode === true) {
1426
- _.$list.css({
1427
- padding: ('0px ' + _.options.centerPadding)
1428
- });
1429
- }
1430
- } else {
1431
- _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
1432
- if (_.options.centerMode === true) {
1433
- _.$list.css({
1434
- padding: (_.options.centerPadding + ' 0px')
1435
- });
1436
- }
1437
- }
1431
+ var _ = this;
1438
1432
 
1439
- _.listWidth = _.$list.width();
1440
- _.listHeight = _.$list.height();
1433
+ if (_.options.vertical === false) {
1434
+ if (_.options.centerMode === true) {
1435
+ _.$list.css({
1436
+ padding: ('0px ' + _.options.centerPadding)
1437
+ });
1438
+ }
1439
+ } else {
1440
+ _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
1441
+ if (_.options.centerMode === true) {
1442
+ _.$list.css({
1443
+ padding: (_.options.centerPadding + ' 0px')
1444
+ });
1445
+ }
1446
+ }
1441
1447
 
1448
+ _.listWidth = _.$list.width();
1449
+ _.listHeight = _.$list.height();
1442
1450
 
1443
- if(_.options.vertical === false && _.options.variableWidth === false) {
1444
- _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1445
- _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
1446
1451
 
1447
- } else if (_.options.variableWidth === true) {
1448
- var trackWidth = 0;
1449
- _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1450
- _.$slideTrack.children('.slick-slide').each(function(){
1451
- trackWidth += _.listWidth;
1452
- });
1453
- _.$slideTrack.width(Math.ceil(trackWidth) + 1);
1454
- } else {
1455
- _.slideWidth = Math.ceil(_.listWidth);
1456
- _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
1457
- }
1452
+ if(_.options.vertical === false && _.options.variableWidth === false) {
1453
+ _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1454
+ _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
1458
1455
 
1459
- var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
1460
- if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
1456
+ } else if (_.options.variableWidth === true) {
1457
+ var trackWidth = 0;
1458
+ _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1459
+ _.$slideTrack.children('.slick-slide').each(function(){
1460
+ trackWidth += _.listWidth;
1461
+ });
1462
+ _.$slideTrack.width(Math.ceil(trackWidth) + 1);
1463
+ } else {
1464
+ _.slideWidth = Math.ceil(_.listWidth);
1465
+ _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
1466
+ }
1461
1467
 
1462
- };
1468
+ var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
1469
+ if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
1463
1470
 
1464
- Slick.prototype.setFade = function() {
1471
+ };
1465
1472
 
1466
- var _ = this,
1467
- targetLeft;
1468
-
1469
- _.$slides.each(function(index, element) {
1470
- targetLeft = (_.slideWidth * index) * -1;
1471
- if (_.options.rtl === true) {
1472
- $(element).css({
1473
- position: 'relative',
1474
- right: targetLeft,
1475
- top: 0,
1476
- zIndex: 800,
1477
- opacity: 0
1478
- });
1479
- } else {
1480
- $(element).css({
1481
- position: 'relative',
1482
- left: targetLeft,
1483
- top: 0,
1484
- zIndex: 800,
1485
- opacity: 0
1486
- });
1487
- }
1488
- });
1489
-
1490
- _.$slides.eq(_.currentSlide).css({
1491
- zIndex: 900,
1492
- opacity: 1
1493
- });
1494
-
1495
- };
1496
-
1497
- Slick.prototype.setHeight = function() {
1498
-
1499
- var _ = this;
1500
-
1501
- if(_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
1502
- var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
1503
- _.$list.css('height', targetHeight);
1504
- }
1505
-
1506
- };
1507
-
1508
- Slick.prototype.setOption = Slick.prototype.slickSetOption = function(option, value, refresh) {
1509
-
1510
- var _ = this;
1511
- _.options[option] = value;
1512
-
1513
- if (refresh === true) {
1514
- _.unload();
1515
- _.reinit();
1516
- }
1517
-
1518
- };
1519
-
1520
- Slick.prototype.setPosition = function() {
1521
-
1522
- var _ = this;
1523
-
1524
- _.setDimensions();
1525
-
1526
- _.setHeight();
1527
-
1528
- if (_.options.fade === false) {
1529
- _.setCSS(_.getLeft(_.currentSlide));
1530
- } else {
1531
- _.setFade();
1532
- }
1533
-
1534
- _.$slider.trigger("setPosition", [ _ ]);
1535
-
1536
- };
1537
-
1538
- Slick.prototype.setProps = function() {
1539
-
1540
- var _ = this,
1541
- bodyStyle = document.body.style;
1542
-
1543
- _.positionProp = _.options.vertical === true ? 'top' : 'left';
1544
-
1545
- if (_.positionProp === 'top') {
1546
- _.$slider.addClass('slick-vertical');
1547
- } else {
1548
- _.$slider.removeClass('slick-vertical');
1549
- }
1550
-
1551
- if (bodyStyle.WebkitTransition !== undefined ||
1552
- bodyStyle.MozTransition !== undefined ||
1553
- bodyStyle.msTransition !== undefined) {
1554
- if(_.options.useCSS === true) {
1555
- _.cssTransitions = true;
1556
- }
1557
- }
1473
+ Slick.prototype.setFade = function() {
1558
1474
 
1559
- if (bodyStyle.OTransform !== undefined) {
1560
- _.animType = 'OTransform';
1561
- _.transformType = "-o-transform";
1562
- _.transitionType = 'OTransition';
1563
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1564
- }
1565
- if (bodyStyle.MozTransform !== undefined) {
1566
- _.animType = 'MozTransform';
1567
- _.transformType = "-moz-transform";
1568
- _.transitionType = 'MozTransition';
1569
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
1570
- }
1571
- if (bodyStyle.webkitTransform !== undefined) {
1572
- _.animType = 'webkitTransform';
1573
- _.transformType = "-webkit-transform";
1574
- _.transitionType = 'webkitTransition';
1575
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1576
- }
1577
- if (bodyStyle.msTransform !== undefined) {
1578
- _.animType = 'msTransform';
1579
- _.transformType = "-ms-transform";
1580
- _.transitionType = 'msTransition';
1581
- if (bodyStyle.msTransform === undefined) _.animType = false;
1582
- }
1583
- if (bodyStyle.transform !== undefined && _.animType !== false) {
1584
- _.animType = 'transform';
1585
- _.transformType = "transform";
1586
- _.transitionType = 'transition';
1587
- }
1588
- _.transformsEnabled = (_.animType !== null && _.animType !== false);
1475
+ var _ = this,
1476
+ targetLeft;
1589
1477
 
1590
- };
1478
+ _.$slides.each(function(index, element) {
1479
+ targetLeft = (_.slideWidth * index) * -1;
1480
+ if (_.options.rtl === true) {
1481
+ $(element).css({
1482
+ position: 'relative',
1483
+ right: targetLeft,
1484
+ top: 0,
1485
+ zIndex: 800,
1486
+ opacity: 0
1487
+ });
1488
+ } else {
1489
+ $(element).css({
1490
+ position: 'relative',
1491
+ left: targetLeft,
1492
+ top: 0,
1493
+ zIndex: 800,
1494
+ opacity: 0
1495
+ });
1496
+ }
1497
+ });
1591
1498
 
1499
+ _.$slides.eq(_.currentSlide).css({
1500
+ zIndex: 900,
1501
+ opacity: 1
1502
+ });
1592
1503
 
1593
- Slick.prototype.setSlideClasses = function(index) {
1504
+ };
1594
1505
 
1595
- var _ = this,
1596
- centerOffset, allSlides, indexOffset, remainder;
1506
+ Slick.prototype.setHeight = function() {
1597
1507
 
1598
- _.$slider.find('.slick-slide').removeClass('slick-active').attr("aria-hidden","true").removeClass('slick-center');
1599
- allSlides = _.$slider.find('.slick-slide');
1508
+ var _ = this;
1600
1509
 
1601
- if (_.options.centerMode === true) {
1602
-
1603
- centerOffset = Math.floor(_.options.slidesToShow / 2);
1604
-
1605
- if(_.options.infinite === true) {
1606
-
1607
- if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
1608
- _.$slides.slice(index - centerOffset, index + centerOffset + 1).addClass('slick-active').attr("aria-hidden","false");
1609
- } else {
1610
- indexOffset = _.options.slidesToShow + index;
1611
- allSlides.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2).addClass('slick-active').attr("aria-hidden","false");
1612
- }
1613
-
1614
- if (index === 0) {
1615
- allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass('slick-center');
1616
- } else if (index === _.slideCount - 1) {
1617
- allSlides.eq(_.options.slidesToShow).addClass('slick-center');
1618
- }
1619
-
1620
- }
1621
-
1622
- _.$slides.eq(index).addClass('slick-center');
1623
-
1624
- } else {
1625
-
1626
- if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
1627
- _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active').attr("aria-hidden","false");
1628
- } else if ( allSlides.length <= _.options.slidesToShow ) {
1629
- allSlides.addClass('slick-active').attr("aria-hidden","false");
1630
- } else {
1631
- remainder = _.slideCount%_.options.slidesToShow;
1632
- indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
1633
- if(_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
1634
- allSlides.slice(indexOffset-(_.options.slidesToShow-remainder), indexOffset + remainder).addClass('slick-active').attr("aria-hidden","false");
1635
- } else {
1636
- allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active').attr("aria-hidden","false");
1637
- }
1638
- }
1639
-
1640
- }
1641
-
1642
- if (_.options.lazyLoad === 'ondemand') {
1643
- _.lazyLoad();
1644
- }
1645
-
1646
- };
1647
-
1648
- Slick.prototype.setupInfinite = function() {
1649
-
1650
- var _ = this,
1651
- i, slideIndex, infiniteCount;
1652
-
1653
- if (_.options.fade === true) {
1654
- _.options.centerMode = false;
1655
- }
1656
-
1657
- if (_.options.infinite === true && _.options.fade === false) {
1658
-
1659
- slideIndex = null;
1660
-
1661
- if (_.slideCount > _.options.slidesToShow) {
1662
-
1663
- if (_.options.centerMode === true) {
1664
- infiniteCount = _.options.slidesToShow + 1;
1665
- } else {
1666
- infiniteCount = _.options.slidesToShow;
1667
- }
1668
-
1669
- for (i = _.slideCount; i > (_.slideCount -
1670
- infiniteCount); i -= 1) {
1671
- slideIndex = i - 1;
1672
- $(_.$slides[slideIndex]).clone(true).attr('id', '')
1673
- .attr('data-slick-index', slideIndex-_.slideCount)
1674
- .prependTo(_.$slideTrack).addClass('slick-cloned');
1675
- }
1676
- for (i = 0; i < infiniteCount; i += 1) {
1677
- slideIndex = i;
1678
- $(_.$slides[slideIndex]).clone(true).attr('id', '')
1679
- .attr('data-slick-index', slideIndex+_.slideCount)
1680
- .appendTo(_.$slideTrack).addClass('slick-cloned');
1681
- }
1682
- _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
1683
- $(this).attr('id', '');
1684
- });
1685
-
1686
- }
1687
-
1688
- }
1689
-
1690
- };
1691
-
1692
- Slick.prototype.selectHandler = function(event) {
1693
-
1694
- var _ = this;
1695
- var index = parseInt($(event.target).parents('.slick-slide').attr("data-slick-index"));
1696
- if(!index) index = 0;
1697
-
1698
- if(_.slideCount <= _.options.slidesToShow){
1699
- _.$slider.find('.slick-slide').removeClass('slick-active').attr("aria-hidden","true");
1700
- _.$slides.eq(index).addClass('slick-active').attr("aria-hidden","false");
1701
- if(_.options.centerMode === true) {
1702
- _.$slider.find('.slick-slide').removeClass('slick-center');
1703
- _.$slides.eq(index).addClass('slick-center');
1704
- }
1705
- _.asNavFor(index);
1706
- return;
1707
- }
1708
- _.slideHandler(index);
1709
-
1710
- };
1711
-
1712
- Slick.prototype.slideHandler = function(index,sync,dontAnimate) {
1713
-
1714
- var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
1715
- _ = this;
1716
-
1717
- sync = sync || false;
1718
-
1719
- if (_.animating === true && _.options.waitForAnimate === true) {
1720
- return;
1721
- }
1722
-
1723
- if (_.options.fade === true && _.currentSlide === index) {
1724
- return;
1725
- }
1726
-
1727
- if (_.slideCount <= _.options.slidesToShow) {
1728
- return;
1729
- }
1730
-
1731
- if (sync === false) {
1732
- _.asNavFor(index);
1733
- }
1734
-
1735
- targetSlide = index;
1736
- targetLeft = _.getLeft(targetSlide);
1737
- slideLeft = _.getLeft(_.currentSlide);
1738
-
1739
- _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
1740
-
1741
- if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
1742
- if(_.options.fade === false) {
1743
- targetSlide = _.currentSlide;
1744
- if(dontAnimate!==true) {
1745
- _.animateSlide(slideLeft, function() {
1746
- _.postSlide(targetSlide);
1747
- });
1748
- } else {
1749
- _.postSlide(targetSlide);
1750
- }
1751
- }
1752
- return;
1753
- } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
1754
- if(_.options.fade === false) {
1755
- targetSlide = _.currentSlide;
1756
- if(dontAnimate!==true) {
1757
- _.animateSlide(slideLeft, function() {
1758
- _.postSlide(targetSlide);
1759
- });
1760
- } else {
1761
- _.postSlide(targetSlide);
1762
- }
1763
- }
1764
- return;
1765
- }
1766
-
1767
- if (_.options.autoplay === true) {
1768
- clearInterval(_.autoPlayTimer);
1769
- }
1770
-
1771
- if (targetSlide < 0) {
1772
- if (_.slideCount % _.options.slidesToScroll !== 0) {
1773
- animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
1774
- } else {
1775
- animSlide = _.slideCount + targetSlide;
1776
- }
1777
- } else if (targetSlide >= _.slideCount) {
1778
- if (_.slideCount % _.options.slidesToScroll !== 0) {
1779
- animSlide = 0;
1780
- } else {
1781
- animSlide = targetSlide - _.slideCount;
1782
- }
1783
- } else {
1784
- animSlide = targetSlide;
1785
- }
1510
+ if(_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
1511
+ var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
1512
+ _.$list.css('height', targetHeight);
1513
+ }
1786
1514
 
1787
- _.animating = true;
1515
+ };
1788
1516
 
1789
- _.$slider.trigger("beforeChange", [ _ , _.currentSlide, animSlide]);
1790
-
1791
- oldSlide = _.currentSlide;
1792
- _.currentSlide = animSlide;
1793
-
1794
- _.setSlideClasses(_.currentSlide);
1795
-
1796
- _.updateDots();
1797
- _.updateArrows();
1798
-
1799
- if (_.options.fade === true) {
1800
- if(dontAnimate!==true) {
1801
- _.fadeSlide(animSlide, function() {
1802
- _.postSlide(animSlide);
1803
- });
1804
- } else {
1805
- _.postSlide(animSlide);
1806
- }
1807
- _.animateHeight();
1808
- return;
1809
- }
1810
-
1811
- if(dontAnimate!==true) {
1812
- _.animateSlide(targetLeft, function() {
1813
- _.postSlide(animSlide);
1814
- });
1815
- } else {
1816
- _.postSlide(animSlide);
1817
- }
1818
-
1819
- };
1820
-
1821
- Slick.prototype.startLoad = function() {
1822
-
1823
- var _ = this;
1824
-
1825
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1826
-
1827
- _.$prevArrow.hide();
1828
- _.$nextArrow.hide();
1829
-
1830
- }
1831
-
1832
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1833
-
1834
- _.$dots.hide();
1835
-
1836
- }
1837
-
1838
- _.$slider.addClass('slick-loading');
1839
-
1840
- };
1841
-
1842
- Slick.prototype.swipeDirection = function() {
1843
-
1844
- var xDist, yDist, r, swipeAngle, _ = this;
1845
-
1846
- xDist = _.touchObject.startX - _.touchObject.curX;
1847
- yDist = _.touchObject.startY - _.touchObject.curY;
1848
- r = Math.atan2(yDist, xDist);
1517
+ Slick.prototype.setOption = Slick.prototype.slickSetOption = function(option, value, refresh) {
1849
1518
 
1850
- swipeAngle = Math.round(r * 180 / Math.PI);
1851
- if (swipeAngle < 0) {
1852
- swipeAngle = 360 - Math.abs(swipeAngle);
1853
- }
1519
+ var _ = this;
1520
+ _.options[option] = value;
1854
1521
 
1855
- if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
1856
- return (_.options.rtl === false ? 'left' : 'right');
1857
- }
1858
- if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
1859
- return (_.options.rtl === false ? 'left' : 'right');
1860
- }
1861
- if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
1862
- return (_.options.rtl === false ? 'right' : 'left');
1863
- }
1522
+ if (refresh === true) {
1523
+ _.unload();
1524
+ _.reinit();
1525
+ }
1864
1526
 
1865
- return 'vertical';
1527
+ };
1866
1528
 
1867
- };
1529
+ Slick.prototype.setPosition = function() {
1868
1530
 
1869
- Slick.prototype.swipeEnd = function(event) {
1531
+ var _ = this;
1870
1532
 
1871
- var _ = this, slideCount;
1533
+ _.setDimensions();
1872
1534
 
1873
- _.dragging = false;
1535
+ _.setHeight();
1874
1536
 
1875
- _.shouldClick = (_.touchObject.swipeLength > 10) ? false : true;
1537
+ if (_.options.fade === false) {
1538
+ _.setCSS(_.getLeft(_.currentSlide));
1539
+ } else {
1540
+ _.setFade();
1541
+ }
1876
1542
 
1877
- if (_.touchObject.curX === undefined) {
1878
- return false;
1879
- }
1543
+ _.$slider.trigger("setPosition", [ _ ]);
1880
1544
 
1881
- if (_.touchObject.edgeHit === true) {
1882
- _.$slider.trigger("edge", [ _, _.swipeDirection()]);
1883
- }
1545
+ };
1884
1546
 
1885
- if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
1547
+ Slick.prototype.setProps = function() {
1886
1548
 
1887
- switch (_.swipeDirection()) {
1888
- case 'left':
1889
- slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount();
1890
- _.slideHandler(slideCount);
1891
- _.currentDirection = 0;
1892
- _.touchObject = {};
1893
- _.$slider.trigger("swipe", [ _, "left"]);
1894
- break;
1549
+ var _ = this,
1550
+ bodyStyle = document.body.style;
1895
1551
 
1896
- case 'right':
1897
- slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount();
1898
- _.slideHandler(slideCount);
1899
- _.currentDirection = 1;
1900
- _.touchObject = {};
1901
- _.$slider.trigger("swipe", [ _, "right"]);
1902
- break;
1903
- }
1904
- } else {
1905
- if(_.touchObject.startX !== _.touchObject.curX) {
1906
- _.slideHandler(_.currentSlide);
1907
- _.touchObject = {};
1908
- }
1909
- }
1552
+ _.positionProp = _.options.vertical === true ? 'top' : 'left';
1910
1553
 
1911
- };
1554
+ if (_.positionProp === 'top') {
1555
+ _.$slider.addClass('slick-vertical');
1556
+ } else {
1557
+ _.$slider.removeClass('slick-vertical');
1558
+ }
1912
1559
 
1913
- Slick.prototype.swipeHandler = function(event) {
1560
+ if (bodyStyle.WebkitTransition !== undefined ||
1561
+ bodyStyle.MozTransition !== undefined ||
1562
+ bodyStyle.msTransition !== undefined) {
1563
+ if(_.options.useCSS === true) {
1564
+ _.cssTransitions = true;
1565
+ }
1566
+ }
1914
1567
 
1915
- var _ = this;
1568
+ if (bodyStyle.OTransform !== undefined) {
1569
+ _.animType = 'OTransform';
1570
+ _.transformType = "-o-transform";
1571
+ _.transitionType = 'OTransition';
1572
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1573
+ }
1574
+ if (bodyStyle.MozTransform !== undefined) {
1575
+ _.animType = 'MozTransform';
1576
+ _.transformType = "-moz-transform";
1577
+ _.transitionType = 'MozTransition';
1578
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
1579
+ }
1580
+ if (bodyStyle.webkitTransform !== undefined) {
1581
+ _.animType = 'webkitTransform';
1582
+ _.transformType = "-webkit-transform";
1583
+ _.transitionType = 'webkitTransition';
1584
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1585
+ }
1586
+ if (bodyStyle.msTransform !== undefined) {
1587
+ _.animType = 'msTransform';
1588
+ _.transformType = "-ms-transform";
1589
+ _.transitionType = 'msTransition';
1590
+ if (bodyStyle.msTransform === undefined) _.animType = false;
1591
+ }
1592
+ if (bodyStyle.transform !== undefined && _.animType !== false) {
1593
+ _.animType = 'transform';
1594
+ _.transformType = "transform";
1595
+ _.transitionType = 'transition';
1596
+ }
1597
+ _.transformsEnabled = (_.animType !== null && _.animType !== false);
1916
1598
 
1917
- if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
1918
- return;
1919
- } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
1920
- return;
1921
- }
1599
+ };
1600
+
1601
+
1602
+ Slick.prototype.setSlideClasses = function(index) {
1603
+
1604
+ var _ = this,
1605
+ centerOffset, allSlides, indexOffset, remainder;
1606
+
1607
+ _.$slider.find('.slick-slide').removeClass('slick-active').attr("aria-hidden","true").removeClass('slick-center');
1608
+ allSlides = _.$slider.find('.slick-slide');
1609
+
1610
+ if (_.options.centerMode === true) {
1922
1611
 
1923
- _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
1924
- event.originalEvent.touches.length : 1;
1612
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
1925
1613
 
1926
- _.touchObject.minSwipe = _.listWidth / _.options
1927
- .touchThreshold;
1614
+ if(_.options.infinite === true) {
1928
1615
 
1929
- switch (event.data.action) {
1616
+ if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
1617
+ _.$slides.slice(index - centerOffset, index + centerOffset + 1).addClass('slick-active').attr("aria-hidden","false");
1618
+ } else {
1619
+ indexOffset = _.options.slidesToShow + index;
1620
+ allSlides.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2).addClass('slick-active').attr("aria-hidden","false");
1621
+ }
1930
1622
 
1931
- case 'start':
1932
- _.swipeStart(event);
1933
- break;
1623
+ if (index === 0) {
1624
+ allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass('slick-center');
1625
+ } else if (index === _.slideCount - 1) {
1626
+ allSlides.eq(_.options.slidesToShow).addClass('slick-center');
1627
+ }
1934
1628
 
1935
- case 'move':
1936
- _.swipeMove(event);
1937
- break;
1629
+ }
1630
+
1631
+ _.$slides.eq(index).addClass('slick-center');
1632
+
1633
+ } else {
1938
1634
 
1939
- case 'end':
1940
- _.swipeEnd(event);
1941
- break;
1635
+ if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
1636
+ _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active').attr("aria-hidden","false");
1637
+ } else if ( allSlides.length <= _.options.slidesToShow ) {
1638
+ allSlides.addClass('slick-active').attr("aria-hidden","false");
1639
+ } else {
1640
+ remainder = _.slideCount%_.options.slidesToShow;
1641
+ indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
1642
+ if(_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
1643
+ allSlides.slice(indexOffset-(_.options.slidesToShow-remainder), indexOffset + remainder).addClass('slick-active').attr("aria-hidden","false");
1644
+ } else {
1645
+ allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active').attr("aria-hidden","false");
1646
+ }
1647
+ }
1942
1648
 
1943
- }
1649
+ }
1944
1650
 
1945
- };
1651
+ if (_.options.lazyLoad === 'ondemand') {
1652
+ _.lazyLoad();
1653
+ }
1946
1654
 
1947
- Slick.prototype.swipeMove = function(event) {
1655
+ };
1948
1656
 
1949
- var _ = this,
1950
- edgeWasHit = false,
1951
- curLeft, swipeDirection, swipeLength, positionOffset, touches;
1657
+ Slick.prototype.setupInfinite = function() {
1952
1658
 
1953
- touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
1659
+ var _ = this,
1660
+ i, slideIndex, infiniteCount;
1954
1661
 
1955
- if (!_.dragging || touches && touches.length !== 1) {
1956
- return false;
1957
- }
1662
+ if (_.options.fade === true) {
1663
+ _.options.centerMode = false;
1664
+ }
1958
1665
 
1959
- curLeft = _.getLeft(_.currentSlide);
1666
+ if (_.options.infinite === true && _.options.fade === false) {
1667
+
1668
+ slideIndex = null;
1669
+
1670
+ if (_.slideCount > _.options.slidesToShow) {
1671
+
1672
+ if (_.options.centerMode === true) {
1673
+ infiniteCount = _.options.slidesToShow + 1;
1674
+ } else {
1675
+ infiniteCount = _.options.slidesToShow;
1676
+ }
1677
+
1678
+ for (i = _.slideCount; i > (_.slideCount -
1679
+ infiniteCount); i -= 1) {
1680
+ slideIndex = i - 1;
1681
+ $(_.$slides[slideIndex]).clone(true).attr('id', '')
1682
+ .attr('data-slick-index', slideIndex-_.slideCount)
1683
+ .prependTo(_.$slideTrack).addClass('slick-cloned');
1684
+ }
1685
+ for (i = 0; i < infiniteCount; i += 1) {
1686
+ slideIndex = i;
1687
+ $(_.$slides[slideIndex]).clone(true).attr('id', '')
1688
+ .attr('data-slick-index', slideIndex+_.slideCount)
1689
+ .appendTo(_.$slideTrack).addClass('slick-cloned');
1690
+ }
1691
+ _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
1692
+ $(this).attr('id', '');
1693
+ });
1960
1694
 
1961
- _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
1962
- _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
1695
+ }
1963
1696
 
1964
- _.touchObject.swipeLength = Math.round(Math.sqrt(
1965
- Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
1697
+ }
1966
1698
 
1967
- swipeDirection = _.swipeDirection();
1699
+ };
1968
1700
 
1969
- if (swipeDirection === 'vertical') {
1970
- return;
1971
- }
1701
+ Slick.prototype.selectHandler = function(event) {
1972
1702
 
1973
- if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
1974
- event.preventDefault();
1975
- }
1703
+ var _ = this;
1704
+ var index = parseInt($(event.target).parents('.slick-slide').attr("data-slick-index"));
1705
+ if(!index) index = 0;
1706
+
1707
+ if(_.slideCount <= _.options.slidesToShow){
1708
+ _.$slider.find('.slick-slide').removeClass('slick-active').attr("aria-hidden","true");
1709
+ _.$slides.eq(index).addClass('slick-active').attr("aria-hidden","false");
1710
+ if(_.options.centerMode === true) {
1711
+ _.$slider.find('.slick-slide').removeClass('slick-center');
1712
+ _.$slides.eq(index).addClass('slick-center');
1713
+ }
1714
+ _.asNavFor(index);
1715
+ return;
1716
+ }
1717
+ _.slideHandler(index);
1976
1718
 
1977
- positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
1719
+ };
1978
1720
 
1979
- swipeLength = _.touchObject.swipeLength;
1721
+ Slick.prototype.slideHandler = function(index,sync,dontAnimate) {
1980
1722
 
1981
- _.touchObject.edgeHit = false;
1723
+ var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
1724
+ _ = this;
1982
1725
 
1983
- if (_.options.infinite === false) {
1984
- if ((_.currentSlide === 0 && swipeDirection === "right") || (_.currentSlide >= _.getDotCount() && swipeDirection === "left")) {
1985
- swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
1986
- _.touchObject.edgeHit = true;
1987
- }
1988
- }
1726
+ sync = sync || false;
1989
1727
 
1990
- if (_.options.vertical === false) {
1991
- _.swipeLeft = curLeft + swipeLength * positionOffset;
1992
- } else {
1993
- _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
1994
- }
1728
+ if (_.animating === true && _.options.waitForAnimate === true) {
1729
+ return;
1730
+ }
1995
1731
 
1996
- if (_.options.fade === true || _.options.touchMove === false) {
1997
- return false;
1998
- }
1732
+ if (_.options.fade === true && _.currentSlide === index) {
1733
+ return;
1734
+ }
1999
1735
 
2000
- if (_.animating === true) {
2001
- _.swipeLeft = null;
2002
- return false;
2003
- }
1736
+ if (_.slideCount <= _.options.slidesToShow) {
1737
+ return;
1738
+ }
2004
1739
 
2005
- _.setCSS(_.swipeLeft);
1740
+ if (sync === false) {
1741
+ _.asNavFor(index);
1742
+ }
2006
1743
 
2007
- };
1744
+ targetSlide = index;
1745
+ targetLeft = _.getLeft(targetSlide);
1746
+ slideLeft = _.getLeft(_.currentSlide);
1747
+
1748
+ _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
1749
+
1750
+ if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
1751
+ if(_.options.fade === false) {
1752
+ targetSlide = _.currentSlide;
1753
+ if(dontAnimate!==true) {
1754
+ _.animateSlide(slideLeft, function() {
1755
+ _.postSlide(targetSlide);
1756
+ });
1757
+ } else {
1758
+ _.postSlide(targetSlide);
1759
+ }
1760
+ }
1761
+ return;
1762
+ } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
1763
+ if(_.options.fade === false) {
1764
+ targetSlide = _.currentSlide;
1765
+ if(dontAnimate!==true) {
1766
+ _.animateSlide(slideLeft, function() {
1767
+ _.postSlide(targetSlide);
1768
+ });
1769
+ } else {
1770
+ _.postSlide(targetSlide);
1771
+ }
1772
+ }
1773
+ return;
1774
+ }
2008
1775
 
2009
- Slick.prototype.swipeStart = function(event) {
1776
+ if (_.options.autoplay === true) {
1777
+ clearInterval(_.autoPlayTimer);
1778
+ }
2010
1779
 
2011
- var _ = this,
2012
- touches;
1780
+ if (targetSlide < 0) {
1781
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
1782
+ animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
1783
+ } else {
1784
+ animSlide = _.slideCount + targetSlide;
1785
+ }
1786
+ } else if (targetSlide >= _.slideCount) {
1787
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
1788
+ animSlide = 0;
1789
+ } else {
1790
+ animSlide = targetSlide - _.slideCount;
1791
+ }
1792
+ } else {
1793
+ animSlide = targetSlide;
1794
+ }
2013
1795
 
2014
- if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2015
- _.touchObject = {};
2016
- return false;
2017
- }
1796
+ _.animating = true;
2018
1797
 
2019
- if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2020
- touches = event.originalEvent.touches[0];
2021
- }
1798
+ _.$slider.trigger("beforeChange", [ _ , _.currentSlide, animSlide]);
2022
1799
 
2023
- _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2024
- _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
1800
+ oldSlide = _.currentSlide;
1801
+ _.currentSlide = animSlide;
2025
1802
 
2026
- _.dragging = true;
1803
+ _.setSlideClasses(_.currentSlide);
2027
1804
 
2028
- };
1805
+ _.updateDots();
1806
+ _.updateArrows();
2029
1807
 
2030
- Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
1808
+ if (_.options.fade === true) {
1809
+ if(dontAnimate!==true) {
1810
+ _.fadeSlide(animSlide, function() {
1811
+ _.postSlide(animSlide);
1812
+ });
1813
+ } else {
1814
+ _.postSlide(animSlide);
1815
+ }
1816
+ _.animateHeight();
1817
+ return;
1818
+ }
2031
1819
 
2032
- var _ = this;
1820
+ if(dontAnimate!==true) {
1821
+ _.animateSlide(targetLeft, function() {
1822
+ _.postSlide(animSlide);
1823
+ });
1824
+ } else {
1825
+ _.postSlide(animSlide);
1826
+ }
2033
1827
 
2034
- if (_.$slidesCache !== null) {
1828
+ };
2035
1829
 
2036
- _.unload();
1830
+ Slick.prototype.startLoad = function() {
2037
1831
 
2038
- _.$slideTrack.children(this.options.slide).detach();
1832
+ var _ = this;
2039
1833
 
2040
- _.$slidesCache.appendTo(_.$slideTrack);
1834
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
2041
1835
 
2042
- _.reinit();
1836
+ _.$prevArrow.hide();
1837
+ _.$nextArrow.hide();
2043
1838
 
2044
- }
1839
+ }
2045
1840
 
2046
- };
1841
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
2047
1842
 
2048
- Slick.prototype.unload = function() {
1843
+ _.$dots.hide();
2049
1844
 
2050
- var _ = this;
1845
+ }
2051
1846
 
2052
- $('.slick-cloned', _.$slider).remove();
2053
- if (_.$dots) {
2054
- _.$dots.remove();
2055
- }
2056
- if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) {
2057
- _.$prevArrow.remove();
2058
- }
2059
- if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) {
2060
- _.$nextArrow.remove();
2061
- }
2062
- _.$slides.removeClass('slick-slide slick-active slick-visible').attr("aria-hidden","true").css('width', '');
1847
+ _.$slider.addClass('slick-loading');
2063
1848
 
2064
- };
1849
+ };
2065
1850
 
2066
- Slick.prototype.unslick = function() {
1851
+ Slick.prototype.swipeDirection = function() {
2067
1852
 
2068
- var _ = this;
2069
- _.destroy();
1853
+ var xDist, yDist, r, swipeAngle, _ = this;
2070
1854
 
2071
- };
1855
+ xDist = _.touchObject.startX - _.touchObject.curX;
1856
+ yDist = _.touchObject.startY - _.touchObject.curY;
1857
+ r = Math.atan2(yDist, xDist);
2072
1858
 
2073
- Slick.prototype.updateArrows = function() {
1859
+ swipeAngle = Math.round(r * 180 / Math.PI);
1860
+ if (swipeAngle < 0) {
1861
+ swipeAngle = 360 - Math.abs(swipeAngle);
1862
+ }
2074
1863
 
2075
- var _ = this, centerOffset;
1864
+ if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
1865
+ return (_.options.rtl === false ? 'left' : 'right');
1866
+ }
1867
+ if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
1868
+ return (_.options.rtl === false ? 'left' : 'right');
1869
+ }
1870
+ if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
1871
+ return (_.options.rtl === false ? 'right' : 'left');
1872
+ }
2076
1873
 
2077
- centerOffset = Math.floor(_.options.slidesToShow / 2);
1874
+ return 'vertical';
2078
1875
 
2079
- if (_.options.arrows === true && _.options.infinite !==
2080
- true && _.slideCount > _.options.slidesToShow) {
2081
- _.$prevArrow.removeClass('slick-disabled');
2082
- _.$nextArrow.removeClass('slick-disabled');
2083
- if (_.currentSlide === 0) {
2084
- _.$prevArrow.addClass('slick-disabled');
2085
- _.$nextArrow.removeClass('slick-disabled');
2086
- } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2087
- _.$nextArrow.addClass('slick-disabled');
2088
- _.$prevArrow.removeClass('slick-disabled');
2089
- } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2090
- _.$nextArrow.addClass('slick-disabled');
2091
- _.$prevArrow.removeClass('slick-disabled');
2092
- }
2093
- }
1876
+ };
2094
1877
 
2095
- };
1878
+ Slick.prototype.swipeEnd = function(event) {
2096
1879
 
2097
- Slick.prototype.updateDots = function() {
1880
+ var _ = this, slideCount;
2098
1881
 
2099
- var _ = this;
1882
+ _.dragging = false;
2100
1883
 
2101
- if (_.$dots !== null) {
1884
+ _.shouldClick = (_.touchObject.swipeLength > 10) ? false : true;
2102
1885
 
2103
- _.$dots.find('li').removeClass('slick-active').attr("aria-hidden","true");
2104
- _.$dots.find('li').eq(Math.floor(_.currentSlide / _.options.slidesToScroll)).addClass('slick-active').attr("aria-hidden","false");
1886
+ if (_.touchObject.curX === undefined) {
1887
+ return false;
1888
+ }
2105
1889
 
2106
- }
1890
+ if (_.touchObject.edgeHit === true) {
1891
+ _.$slider.trigger("edge", [ _, _.swipeDirection()]);
1892
+ }
2107
1893
 
2108
- };
1894
+ if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
1895
+
1896
+ switch (_.swipeDirection()) {
1897
+ case 'left':
1898
+ slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount();
1899
+ _.slideHandler(slideCount);
1900
+ _.currentDirection = 0;
1901
+ _.touchObject = {};
1902
+ _.$slider.trigger("swipe", [ _, "left"]);
1903
+ break;
1904
+
1905
+ case 'right':
1906
+ slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount();
1907
+ _.slideHandler(slideCount);
1908
+ _.currentDirection = 1;
1909
+ _.touchObject = {};
1910
+ _.$slider.trigger("swipe", [ _, "right"]);
1911
+ break;
1912
+ }
1913
+ } else {
1914
+ if(_.touchObject.startX !== _.touchObject.curX) {
1915
+ _.slideHandler(_.currentSlide);
1916
+ _.touchObject = {};
1917
+ }
1918
+ }
2109
1919
 
2110
- Slick.prototype.visibility = function() {
1920
+ };
2111
1921
 
2112
- var _ = this;
1922
+ Slick.prototype.swipeHandler = function(event) {
2113
1923
 
2114
- if( document[ _.hidden ] ) {
2115
- _.paused = true;
2116
- _.autoPlayClear();
2117
- } else {
2118
- _.paused = false;
2119
- _.autoPlay();
2120
- }
1924
+ var _ = this;
2121
1925
 
2122
- };
1926
+ if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
1927
+ return;
1928
+ } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
1929
+ return;
1930
+ }
2123
1931
 
2124
- $.fn.slick = function() {
2125
- var _ = this, opt = arguments[0], args = Array.prototype.slice.call(arguments,1), l = _.length, i = 0, ret;
2126
- for(i; i < l; i++) {
2127
- if (typeof opt == 'object' || typeof opt == 'undefined')
2128
- _[i].slick = new Slick(_[i], opt);
2129
- else
2130
- ret = _[i].slick[opt].apply(_[i].slick, args);
2131
- if (typeof ret != 'undefined') return ret;
2132
- }
2133
- return _;
2134
- };
1932
+ _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
1933
+ event.originalEvent.touches.length : 1;
1934
+
1935
+ _.touchObject.minSwipe = _.listWidth / _.options
1936
+ .touchThreshold;
1937
+
1938
+ switch (event.data.action) {
1939
+
1940
+ case 'start':
1941
+ _.swipeStart(event);
1942
+ break;
1943
+
1944
+ case 'move':
1945
+ _.swipeMove(event);
1946
+ break;
1947
+
1948
+ case 'end':
1949
+ _.swipeEnd(event);
1950
+ break;
1951
+
1952
+ }
1953
+
1954
+ };
1955
+
1956
+ Slick.prototype.swipeMove = function(event) {
1957
+
1958
+ var _ = this,
1959
+ edgeWasHit = false,
1960
+ curLeft, swipeDirection, swipeLength, positionOffset, touches;
1961
+
1962
+ touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
1963
+
1964
+ if (!_.dragging || touches && touches.length !== 1) {
1965
+ return false;
1966
+ }
1967
+
1968
+ curLeft = _.getLeft(_.currentSlide);
1969
+
1970
+ _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
1971
+ _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
1972
+
1973
+ _.touchObject.swipeLength = Math.round(Math.sqrt(
1974
+ Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
1975
+
1976
+ swipeDirection = _.swipeDirection();
1977
+
1978
+ if (swipeDirection === 'vertical') {
1979
+ return;
1980
+ }
1981
+
1982
+ if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
1983
+ event.preventDefault();
1984
+ }
1985
+
1986
+ positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
1987
+
1988
+ swipeLength = _.touchObject.swipeLength;
1989
+
1990
+ _.touchObject.edgeHit = false;
1991
+
1992
+ if (_.options.infinite === false) {
1993
+ if ((_.currentSlide === 0 && swipeDirection === "right") || (_.currentSlide >= _.getDotCount() && swipeDirection === "left")) {
1994
+ swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
1995
+ _.touchObject.edgeHit = true;
1996
+ }
1997
+ }
1998
+
1999
+ if (_.options.vertical === false) {
2000
+ _.swipeLeft = curLeft + swipeLength * positionOffset;
2001
+ } else {
2002
+ _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
2003
+ }
2004
+
2005
+ if (_.options.fade === true || _.options.touchMove === false) {
2006
+ return false;
2007
+ }
2008
+
2009
+ if (_.animating === true) {
2010
+ _.swipeLeft = null;
2011
+ return false;
2012
+ }
2013
+
2014
+ _.setCSS(_.swipeLeft);
2015
+
2016
+ };
2017
+
2018
+ Slick.prototype.swipeStart = function(event) {
2019
+
2020
+ var _ = this,
2021
+ touches;
2022
+
2023
+ if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2024
+ _.touchObject = {};
2025
+ return false;
2026
+ }
2027
+
2028
+ if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2029
+ touches = event.originalEvent.touches[0];
2030
+ }
2031
+
2032
+ _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2033
+ _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
2034
+
2035
+ _.dragging = true;
2036
+
2037
+ };
2038
+
2039
+ Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
2040
+
2041
+ var _ = this;
2042
+
2043
+ if (_.$slidesCache !== null) {
2044
+
2045
+ _.unload();
2046
+
2047
+ _.$slideTrack.children(this.options.slide).detach();
2048
+
2049
+ _.$slidesCache.appendTo(_.$slideTrack);
2050
+
2051
+ _.reinit();
2052
+
2053
+ }
2054
+
2055
+ };
2056
+
2057
+ Slick.prototype.unload = function() {
2058
+
2059
+ var _ = this;
2060
+
2061
+ $('.slick-cloned', _.$slider).remove();
2062
+ if (_.$dots) {
2063
+ _.$dots.remove();
2064
+ }
2065
+ if (_.$prevArrow && (typeof _.options.prevArrow !== 'object')) {
2066
+ _.$prevArrow.remove();
2067
+ }
2068
+ if (_.$nextArrow && (typeof _.options.nextArrow !== 'object')) {
2069
+ _.$nextArrow.remove();
2070
+ }
2071
+ _.$slides.removeClass('slick-slide slick-active slick-visible').attr("aria-hidden","true").css('width', '');
2072
+
2073
+ };
2074
+
2075
+ Slick.prototype.unslick = function() {
2076
+
2077
+ var _ = this;
2078
+ _.destroy();
2079
+
2080
+ };
2081
+
2082
+ Slick.prototype.updateArrows = function() {
2083
+
2084
+ var _ = this, centerOffset;
2085
+
2086
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
2087
+
2088
+ if (_.options.arrows === true && _.options.infinite !==
2089
+ true && _.slideCount > _.options.slidesToShow) {
2090
+ _.$prevArrow.removeClass('slick-disabled');
2091
+ _.$nextArrow.removeClass('slick-disabled');
2092
+ if (_.currentSlide === 0) {
2093
+ _.$prevArrow.addClass('slick-disabled');
2094
+ _.$nextArrow.removeClass('slick-disabled');
2095
+ } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2096
+ _.$nextArrow.addClass('slick-disabled');
2097
+ _.$prevArrow.removeClass('slick-disabled');
2098
+ } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2099
+ _.$nextArrow.addClass('slick-disabled');
2100
+ _.$prevArrow.removeClass('slick-disabled');
2101
+ }
2102
+ }
2103
+
2104
+ };
2105
+
2106
+ Slick.prototype.updateDots = function() {
2107
+
2108
+ var _ = this;
2109
+
2110
+ if (_.$dots !== null) {
2111
+
2112
+ _.$dots.find('li').removeClass('slick-active').attr("aria-hidden","true");
2113
+ _.$dots.find('li').eq(Math.floor(_.currentSlide / _.options.slidesToScroll)).addClass('slick-active').attr("aria-hidden","false");
2114
+
2115
+ }
2116
+
2117
+ };
2118
+
2119
+ Slick.prototype.visibility = function() {
2120
+
2121
+ var _ = this;
2122
+
2123
+ if( document[ _.hidden ] ) {
2124
+ _.paused = true;
2125
+ _.autoPlayClear();
2126
+ } else {
2127
+ _.paused = false;
2128
+ _.autoPlay();
2129
+ }
2130
+
2131
+ };
2132
+
2133
+ $.fn.slick = function() {
2134
+ var _ = this, opt = arguments[0], args = Array.prototype.slice.call(arguments,1), l = _.length, i = 0, ret;
2135
+ for(i; i < l; i++) {
2136
+ if (typeof opt == 'object' || typeof opt == 'undefined')
2137
+ _[i].slick = new Slick(_[i], opt);
2138
+ else
2139
+ ret = _[i].slick[opt].apply(_[i].slick, args);
2140
+ if (typeof ret != 'undefined') return ret;
2141
+ }
2142
+ return _;
2143
+ };
2135
2144
 
2136
- $(function(){
2137
- $('[data-slick]').slick();
2138
- });
2145
+ $(function(){
2146
+ $('[data-slick]').slick();
2147
+ });
2139
2148
 
2140
- }));
2149
+ }));