jquery-slick-rails 1.4.1 → 1.5.0

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