slick_rails 1.3.3.1 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/slick.js +559 -606
- data/app/assets/stylesheets/slick.css.scss +23 -7
- data/lib/slick_rails/version.rb +1 -1
- metadata +2 -2
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
/* global window, document, define, jQuery, setInterval, clearInterval */
|
18
18
|
|
19
|
-
(function
|
19
|
+
(function(factory) {
|
20
20
|
'use strict';
|
21
21
|
if (typeof define === 'function' && define.amd) {
|
22
22
|
define(['jquery'], factory);
|
@@ -24,16 +24,18 @@
|
|
24
24
|
factory(jQuery);
|
25
25
|
}
|
26
26
|
|
27
|
-
}(function
|
27
|
+
}(function($) {
|
28
28
|
'use strict';
|
29
29
|
var Slick = window.Slick || {};
|
30
30
|
|
31
|
-
Slick = (function
|
31
|
+
Slick = (function() {
|
32
|
+
|
32
33
|
var instanceUid = 0;
|
33
34
|
|
34
35
|
function Slick(element, settings) {
|
35
36
|
|
36
|
-
var _ = this,
|
37
|
+
var _ = this,
|
38
|
+
responsiveSettings, breakpoint;
|
37
39
|
|
38
40
|
_.defaults = {
|
39
41
|
accessibility: true,
|
@@ -41,8 +43,11 @@
|
|
41
43
|
autoplay: false,
|
42
44
|
autoplaySpeed: 3000,
|
43
45
|
centerMode: false,
|
44
|
-
centerPadding:
|
46
|
+
centerPadding: '50px',
|
45
47
|
cssEase: 'ease',
|
48
|
+
customPaging: function(slider, i) {
|
49
|
+
return '<button type="button">' + (i + 1) + '</button>';
|
50
|
+
},
|
46
51
|
dots: false,
|
47
52
|
draggable: true,
|
48
53
|
easing: 'linear',
|
@@ -51,10 +56,9 @@
|
|
51
56
|
lazyLoad: 'ondemand',
|
52
57
|
onBeforeChange: null,
|
53
58
|
onAfterChange: null,
|
54
|
-
onInit
|
55
|
-
onReInit
|
59
|
+
onInit: null,
|
60
|
+
onReInit: null,
|
56
61
|
pauseOnHover: true,
|
57
|
-
placeholders: true,
|
58
62
|
responsive: null,
|
59
63
|
slide: 'div',
|
60
64
|
slidesToShow: 1,
|
@@ -67,28 +71,27 @@
|
|
67
71
|
};
|
68
72
|
|
69
73
|
_.initials = {
|
70
|
-
animating
|
71
|
-
autoPlayTimer
|
72
|
-
currentSlide
|
73
|
-
currentLeft
|
74
|
-
direction
|
75
|
-
dots
|
76
|
-
listWidth
|
77
|
-
listHeight
|
78
|
-
loadIndex
|
79
|
-
nextArrow
|
80
|
-
prevArrow
|
81
|
-
slideCount
|
82
|
-
slideWidth
|
83
|
-
slideTrack
|
84
|
-
slides
|
85
|
-
sliding
|
86
|
-
slideOffset
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
transformsEnabled : false
|
74
|
+
animating: false,
|
75
|
+
autoPlayTimer: null,
|
76
|
+
currentSlide: 0,
|
77
|
+
currentLeft: null,
|
78
|
+
direction: 1,
|
79
|
+
$dots: null,
|
80
|
+
listWidth: null,
|
81
|
+
listHeight: null,
|
82
|
+
loadIndex: 0,
|
83
|
+
$nextArrow: null,
|
84
|
+
$prevArrow: null,
|
85
|
+
slideCount: null,
|
86
|
+
slideWidth: null,
|
87
|
+
$slideTrack: null,
|
88
|
+
$slides: null,
|
89
|
+
sliding: false,
|
90
|
+
slideOffset: 0,
|
91
|
+
swipeLeft: null,
|
92
|
+
$list: null,
|
93
|
+
touchObject: {},
|
94
|
+
transformsEnabled: false
|
92
95
|
};
|
93
96
|
|
94
97
|
$.extend(_, _.initials);
|
@@ -98,19 +101,20 @@
|
|
98
101
|
_.animProp = null;
|
99
102
|
_.breakpoints = [];
|
100
103
|
_.breakpointSettings = [];
|
104
|
+
_.cssTransitions = false;
|
101
105
|
_.paused = false;
|
102
106
|
_.positionProp = null;
|
103
|
-
_
|
104
|
-
_
|
105
|
-
_.
|
107
|
+
_.$slider = $(element);
|
108
|
+
_.$slidesCache = null;
|
109
|
+
_.transformType = null;
|
110
|
+
_.transitionType = null;
|
106
111
|
_.windowWidth = 0;
|
107
112
|
_.windowTimer = null;
|
108
113
|
|
109
114
|
_.options = $.extend({}, _.defaults, settings);
|
110
115
|
|
111
116
|
_.originalSettings = _.options;
|
112
|
-
responsiveSettings = _.options.responsive ||
|
113
|
-
null;
|
117
|
+
responsiveSettings = _.options.responsive || null;
|
114
118
|
|
115
119
|
if (responsiveSettings && responsiveSettings.length > -1) {
|
116
120
|
for (breakpoint in responsiveSettings) {
|
@@ -122,29 +126,22 @@
|
|
122
126
|
responsiveSettings[breakpoint].settings;
|
123
127
|
}
|
124
128
|
}
|
125
|
-
_.breakpoints.sort(function
|
129
|
+
_.breakpoints.sort(function(a, b) {
|
126
130
|
return b - a;
|
127
131
|
});
|
128
132
|
}
|
129
133
|
|
130
|
-
_.autoPlay = $.proxy(_.autoPlay,
|
131
|
-
|
132
|
-
_.
|
133
|
-
|
134
|
-
_.
|
135
|
-
|
136
|
-
_.
|
137
|
-
|
138
|
-
_.swipeHandler = $.proxy(_.swipeHandler,
|
139
|
-
_);
|
140
|
-
_.dragHandler = $.proxy(_.dragHandler,
|
141
|
-
_);
|
142
|
-
_.keyHandler = $.proxy(_.keyHandler,
|
143
|
-
_);
|
144
|
-
_.autoPlayIterator = $.proxy(_.autoPlayIterator,
|
145
|
-
_);
|
134
|
+
_.autoPlay = $.proxy(_.autoPlay, _);
|
135
|
+
_.autoPlayClear = $.proxy(_.autoPlayClear, _);
|
136
|
+
_.changeSlide = $.proxy(_.changeSlide, _);
|
137
|
+
_.setPosition = $.proxy(_.setPosition, _);
|
138
|
+
_.swipeHandler = $.proxy(_.swipeHandler, _);
|
139
|
+
_.dragHandler = $.proxy(_.dragHandler, _);
|
140
|
+
_.keyHandler = $.proxy(_.keyHandler, _);
|
141
|
+
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
|
146
142
|
|
147
143
|
_.instanceUid = instanceUid++;
|
144
|
+
|
148
145
|
_.init();
|
149
146
|
|
150
147
|
}
|
@@ -153,68 +150,64 @@
|
|
153
150
|
|
154
151
|
}());
|
155
152
|
|
156
|
-
Slick.prototype.addSlide = function
|
153
|
+
Slick.prototype.addSlide = function(markup, index, addBefore) {
|
157
154
|
|
158
|
-
var _ = this
|
159
|
-
slideTrackChildren;
|
155
|
+
var _ = this;
|
160
156
|
|
161
|
-
if (typeof(index) ===
|
157
|
+
if (typeof(index) === 'boolean') {
|
162
158
|
addBefore = index;
|
163
159
|
index = null;
|
160
|
+
} else if (index < 0 || (index >= _.slideCount)) {
|
161
|
+
return false;
|
164
162
|
}
|
165
163
|
|
166
164
|
_.unload();
|
167
165
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
if (index === 0 && $(slideTrackChildren).length === 0) {
|
172
|
-
$(markup).appendTo(_.slideTrack);
|
173
|
-
} else if (index < 0 || (index >= $(slideTrackChildren).length && $(slideTrackChildren).length !== 0) ) {
|
174
|
-
_.reinit();
|
175
|
-
return false;
|
166
|
+
if (typeof(index) === 'number') {
|
167
|
+
if (index === 0 && _.$slides.length === 0) {
|
168
|
+
$(markup).appendTo(_.$slideTrack);
|
176
169
|
} else if (addBefore) {
|
177
|
-
$(markup).insertBefore(
|
170
|
+
$(markup).insertBefore(_.$slides.eq(index));
|
178
171
|
} else {
|
179
|
-
$(markup).insertAfter(
|
172
|
+
$(markup).insertAfter(_.$slides.eq(index));
|
180
173
|
}
|
181
174
|
} else {
|
182
175
|
if (addBefore === true) {
|
183
|
-
$(markup).prependTo(_
|
176
|
+
$(markup).prependTo(_.$slideTrack);
|
184
177
|
} else {
|
185
|
-
$(markup).appendTo(_
|
178
|
+
$(markup).appendTo(_.$slideTrack);
|
186
179
|
}
|
187
180
|
}
|
188
181
|
|
189
|
-
_
|
182
|
+
_.$slides = _.$slideTrack.children(this.options.slide);
|
190
183
|
|
191
|
-
_
|
184
|
+
_.$slideTrack.children(this.options.slide).remove();
|
192
185
|
|
193
|
-
_
|
186
|
+
_.$slideTrack.append(_.$slides);
|
194
187
|
|
195
188
|
_.reinit();
|
196
189
|
|
197
190
|
};
|
198
191
|
|
199
|
-
Slick.prototype.animateSlide = function
|
192
|
+
Slick.prototype.animateSlide = function(targetLeft,
|
200
193
|
callback) {
|
201
194
|
|
202
195
|
var animProps = {}, _ = this;
|
203
196
|
|
204
197
|
if (_.transformsEnabled === false) {
|
205
198
|
if (_.options.vertical === false) {
|
206
|
-
_
|
199
|
+
_.$slideTrack.animate({
|
207
200
|
left: targetLeft
|
208
|
-
}, _.options.speed,_.options.easing, callback);
|
201
|
+
}, _.options.speed, _.options.easing, callback);
|
209
202
|
} else {
|
210
|
-
_
|
203
|
+
_.$slideTrack.animate({
|
211
204
|
top: targetLeft
|
212
|
-
}, _.options.speed,_.options.easing, callback);
|
205
|
+
}, _.options.speed, _.options.easing, callback);
|
213
206
|
}
|
214
207
|
|
215
208
|
} else {
|
216
209
|
|
217
|
-
if(_.cssTransitions === false) {
|
210
|
+
if (_.cssTransitions === false) {
|
218
211
|
|
219
212
|
$({
|
220
213
|
animStart: _.currentLeft
|
@@ -223,18 +216,18 @@
|
|
223
216
|
}, {
|
224
217
|
duration: _.options.speed,
|
225
218
|
easing: _.options.easing,
|
226
|
-
step: function
|
219
|
+
step: function(now) {
|
227
220
|
if (_.options.vertical === false) {
|
228
|
-
animProps[_.animType] =
|
229
|
-
now +
|
230
|
-
_
|
221
|
+
animProps[_.animType] = 'translate(' +
|
222
|
+
now + 'px, 0px)';
|
223
|
+
_.$slideTrack.css(animProps);
|
231
224
|
} else {
|
232
|
-
animProps[_.animType] =
|
233
|
-
now +
|
234
|
-
_
|
225
|
+
animProps[_.animType] = 'translate(0px,' +
|
226
|
+
now + 'px,0px)';
|
227
|
+
_.$slideTrack.css(animProps);
|
235
228
|
}
|
236
229
|
},
|
237
|
-
complete: function
|
230
|
+
complete: function() {
|
238
231
|
if (callback) {
|
239
232
|
callback.call();
|
240
233
|
}
|
@@ -246,18 +239,18 @@
|
|
246
239
|
_.applyTransition();
|
247
240
|
|
248
241
|
if (_.options.vertical === false) {
|
249
|
-
animProps[_.animType] =
|
242
|
+
animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
|
250
243
|
} else {
|
251
|
-
animProps[_.animType] =
|
244
|
+
animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
|
252
245
|
}
|
253
|
-
_
|
246
|
+
_.$slideTrack.css(animProps);
|
254
247
|
|
255
|
-
if(callback) {
|
256
|
-
setTimeout(function(){
|
248
|
+
if (callback) {
|
249
|
+
setTimeout(function() {
|
257
250
|
|
258
|
-
|
251
|
+
_.disableTransition();
|
259
252
|
|
260
|
-
|
253
|
+
callback.call();
|
261
254
|
}, _.options.speed);
|
262
255
|
}
|
263
256
|
|
@@ -267,31 +260,26 @@
|
|
267
260
|
|
268
261
|
};
|
269
262
|
|
270
|
-
Slick.prototype.applyTransition = function
|
263
|
+
Slick.prototype.applyTransition = function(slide) {
|
271
264
|
|
272
|
-
var _ = this,
|
265
|
+
var _ = this,
|
266
|
+
transition = {};
|
273
267
|
|
274
|
-
|
275
|
-
|
276
|
-
origin = (_.listWidth / 2) + ' 50%';
|
268
|
+
if (_.options.fade === false) {
|
269
|
+
transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
|
277
270
|
} else {
|
278
|
-
|
271
|
+
transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
|
279
272
|
}
|
280
273
|
|
281
274
|
if (_.options.fade === false) {
|
282
|
-
_
|
283
|
-
transition: transition,
|
284
|
-
transformOrigin: origin
|
285
|
-
});
|
275
|
+
_.$slideTrack.css(transition);
|
286
276
|
} else {
|
287
|
-
|
288
|
-
transition: transition
|
289
|
-
});
|
277
|
+
_.$slides.eq(slide).css(transition);
|
290
278
|
}
|
291
279
|
|
292
280
|
};
|
293
281
|
|
294
|
-
Slick.prototype.autoPlay = function
|
282
|
+
Slick.prototype.autoPlay = function() {
|
295
283
|
|
296
284
|
var _ = this;
|
297
285
|
|
@@ -299,14 +287,14 @@
|
|
299
287
|
clearInterval(_.autoPlayTimer);
|
300
288
|
}
|
301
289
|
|
302
|
-
if(_.slideCount > _.options.slidesToShow && _.paused !== true) {
|
290
|
+
if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
|
303
291
|
_.autoPlayTimer = setInterval(_.autoPlayIterator,
|
304
292
|
_.options.autoplaySpeed);
|
305
293
|
}
|
306
294
|
|
307
295
|
};
|
308
296
|
|
309
|
-
Slick.prototype.autoPlayClear = function
|
297
|
+
Slick.prototype.autoPlayClear = function() {
|
310
298
|
|
311
299
|
var _ = this;
|
312
300
|
|
@@ -316,7 +304,7 @@
|
|
316
304
|
|
317
305
|
};
|
318
306
|
|
319
|
-
Slick.prototype.autoPlayIterator = function
|
307
|
+
Slick.prototype.autoPlayIterator = function() {
|
320
308
|
|
321
309
|
var _ = this;
|
322
310
|
|
@@ -353,101 +341,81 @@
|
|
353
341
|
|
354
342
|
};
|
355
343
|
|
356
|
-
Slick.prototype.buildArrows = function
|
344
|
+
Slick.prototype.buildArrows = function() {
|
357
345
|
|
358
346
|
var _ = this;
|
359
347
|
|
360
348
|
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
361
349
|
|
362
|
-
_
|
363
|
-
'<button type="button"
|
364
|
-
_
|
365
|
-
_
|
366
|
-
'<button type="button"
|
367
|
-
_
|
350
|
+
_.$prevArrow = $(
|
351
|
+
'<button type="button" class="slick-prev">Previous</button>').appendTo(
|
352
|
+
_.$slider);
|
353
|
+
_.$nextArrow = $(
|
354
|
+
'<button type="button" class="slick-next">Next</button>').appendTo(
|
355
|
+
_.$slider);
|
368
356
|
|
369
357
|
if (_.options.infinite !== true) {
|
370
|
-
_
|
358
|
+
_.$prevArrow.addClass('slick-disabled');
|
371
359
|
}
|
372
360
|
|
373
361
|
}
|
374
362
|
|
375
363
|
};
|
376
364
|
|
377
|
-
Slick.prototype.buildDots = function
|
365
|
+
Slick.prototype.buildDots = function() {
|
378
366
|
|
379
|
-
var _ = this,
|
367
|
+
var _ = this,
|
368
|
+
i, dotString;
|
380
369
|
|
381
370
|
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
382
371
|
|
383
372
|
dotString = '<ul class="slick-dots">';
|
384
373
|
|
385
|
-
for (i =
|
386
|
-
|
387
|
-
dotString += '<li><a href="javascript:void(0)" tabIndex="-1">' + i +
|
388
|
-
'</a></li>';
|
389
|
-
if (_.options.placeholders === false && i +
|
390
|
-
_.options.slidesToShow - (_.options.slidesToScroll - 1) > _.slideCount) {
|
391
|
-
break;
|
392
|
-
}
|
374
|
+
for (i = 0; i <= _.getDotCount(); i += 1) {
|
375
|
+
dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
|
393
376
|
}
|
394
377
|
|
395
|
-
dotString +=
|
378
|
+
dotString += '</ul>';
|
396
379
|
|
397
|
-
_
|
398
|
-
_
|
380
|
+
_.$dots = $(dotString).appendTo(
|
381
|
+
_.$slider);
|
399
382
|
|
400
|
-
|
401
|
-
_.dots.find('li').hide();
|
402
|
-
i = 0;
|
403
|
-
while (i < _.slideCount) {
|
404
|
-
$(_.dots.find('li').get(i)).show();
|
405
|
-
i = i + _.options.slidesToScroll;
|
406
|
-
}
|
407
|
-
}
|
408
|
-
|
409
|
-
_.dots.find('li').first().addClass(
|
383
|
+
_.$dots.find('li').first().addClass(
|
410
384
|
'slick-active');
|
411
385
|
|
412
386
|
}
|
413
387
|
|
414
388
|
};
|
415
389
|
|
416
|
-
Slick.prototype.buildOut = function
|
390
|
+
Slick.prototype.buildOut = function() {
|
417
391
|
|
418
392
|
var _ = this;
|
419
393
|
|
420
|
-
_
|
394
|
+
_.$slides = _.$slider.children(_.options.slide +
|
421
395
|
':not(.slick-cloned)').addClass(
|
422
396
|
'slick-slide');
|
423
|
-
_.slideCount = _
|
424
|
-
_
|
397
|
+
_.slideCount = _.$slides.length;
|
398
|
+
_.$slidesCache = _.$slides;
|
425
399
|
|
426
|
-
_
|
400
|
+
_.$slider.addClass('slick-slider');
|
427
401
|
|
428
|
-
_
|
429
|
-
$('<div class="slick-track"/>').appendTo(_
|
430
|
-
_
|
402
|
+
_.$slideTrack = (_.slideCount === 0) ?
|
403
|
+
$('<div class="slick-track"/>').appendTo(_.$slider) :
|
404
|
+
_.$slides.wrapAll('<div class="slick-track"/>').parent();
|
431
405
|
|
432
|
-
_
|
406
|
+
_.$list = _.$slideTrack.wrap(
|
433
407
|
'<div class="slick-list"/>').parent();
|
434
|
-
_
|
435
|
-
|
436
|
-
if(_.options.accessibility === true) {
|
437
|
-
_.list.prop('tabIndex',0);
|
438
|
-
}
|
408
|
+
_.$slideTrack.css('opacity', 0);
|
439
409
|
|
440
|
-
if(_.options.centerMode === true) {
|
410
|
+
if (_.options.centerMode === true) {
|
441
411
|
_.options.infinite = true;
|
442
412
|
_.options.slidesToScroll = 1;
|
443
|
-
if(_.options.slidesToShow % 2 === 0) {
|
413
|
+
if (_.options.slidesToShow % 2 === 0) {
|
444
414
|
_.options.slidesToShow = 3;
|
445
415
|
}
|
446
416
|
}
|
447
417
|
|
448
|
-
$('img[data-lazy]',_
|
449
|
-
|
450
|
-
_.setupPlaceholders();
|
418
|
+
$('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
|
451
419
|
|
452
420
|
_.setupInfinite();
|
453
421
|
|
@@ -455,17 +423,22 @@
|
|
455
423
|
|
456
424
|
_.buildDots();
|
457
425
|
|
426
|
+
if (_.options.accessibility === true) {
|
427
|
+
_.$list.prop('tabIndex', 0);
|
428
|
+
}
|
429
|
+
|
458
430
|
_.setSlideClasses(0);
|
459
431
|
|
460
432
|
if (_.options.draggable === true) {
|
461
|
-
_
|
433
|
+
_.$list.addClass('draggable');
|
462
434
|
}
|
463
435
|
|
464
436
|
};
|
465
437
|
|
466
|
-
Slick.prototype.checkResponsive = function
|
438
|
+
Slick.prototype.checkResponsive = function() {
|
467
439
|
|
468
|
-
var _ = this,
|
440
|
+
var _ = this,
|
441
|
+
breakpoint, targetBreakpoint;
|
469
442
|
|
470
443
|
if (_.originalSettings.responsive && _.originalSettings
|
471
444
|
.responsive.length > -1 && _.originalSettings.responsive !== null) {
|
@@ -490,21 +463,21 @@
|
|
490
463
|
_.options = $.extend({}, _.defaults,
|
491
464
|
_.breakpointSettings[
|
492
465
|
targetBreakpoint]);
|
493
|
-
|
466
|
+
_.refresh();
|
494
467
|
}
|
495
468
|
} else {
|
496
469
|
_.activeBreakpoint = targetBreakpoint;
|
497
470
|
_.options = $.extend({}, _.defaults,
|
498
471
|
_.breakpointSettings[
|
499
472
|
targetBreakpoint]);
|
500
|
-
|
473
|
+
_.refresh();
|
501
474
|
}
|
502
475
|
} else {
|
503
476
|
if (_.activeBreakpoint !== null) {
|
504
477
|
_.activeBreakpoint = null;
|
505
478
|
_.options = $.extend({}, _.defaults,
|
506
479
|
_.originalSettings);
|
507
|
-
|
480
|
+
_.refresh();
|
508
481
|
}
|
509
482
|
}
|
510
483
|
|
@@ -512,33 +485,33 @@
|
|
512
485
|
|
513
486
|
};
|
514
487
|
|
515
|
-
Slick.prototype.changeSlide = function
|
488
|
+
Slick.prototype.changeSlide = function(event) {
|
516
489
|
|
517
490
|
var _ = this;
|
518
491
|
|
519
492
|
switch (event.data.message) {
|
520
493
|
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
494
|
+
case 'previous':
|
495
|
+
_.slideHandler(_.currentSlide - _.options
|
496
|
+
.slidesToScroll);
|
497
|
+
break;
|
525
498
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
499
|
+
case 'next':
|
500
|
+
_.slideHandler(_.currentSlide + _.options
|
501
|
+
.slidesToScroll);
|
502
|
+
break;
|
530
503
|
|
531
|
-
|
532
|
-
|
533
|
-
|
504
|
+
case 'index':
|
505
|
+
_.slideHandler($(event.target).parent().index() * _.options.slidesToScroll);
|
506
|
+
break;
|
534
507
|
|
535
|
-
|
536
|
-
|
508
|
+
default:
|
509
|
+
return false;
|
537
510
|
}
|
538
511
|
|
539
512
|
};
|
540
513
|
|
541
|
-
Slick.prototype.destroy = function
|
514
|
+
Slick.prototype.destroy = function() {
|
542
515
|
|
543
516
|
var _ = this;
|
544
517
|
|
@@ -546,69 +519,68 @@
|
|
546
519
|
|
547
520
|
_.touchObject = {};
|
548
521
|
|
549
|
-
$('.slick-cloned', _
|
550
|
-
|
551
|
-
|
552
|
-
_.dots.remove();
|
522
|
+
$('.slick-cloned', _.$slider).remove();
|
523
|
+
if (_.$dots) {
|
524
|
+
_.$dots.remove();
|
553
525
|
}
|
554
|
-
if (_
|
555
|
-
_
|
556
|
-
_
|
526
|
+
if (_.$prevArrow) {
|
527
|
+
_.$prevArrow.remove();
|
528
|
+
_.$nextArrow.remove();
|
557
529
|
}
|
558
|
-
_
|
559
|
-
_
|
530
|
+
_.$slides.unwrap().unwrap();
|
531
|
+
_.$slides.removeClass(
|
560
532
|
'slick-slide slick-active slick-visible').removeAttr('style');
|
561
|
-
_
|
562
|
-
_
|
533
|
+
_.$slider.removeClass('slick-slider');
|
534
|
+
_.$slider.removeClass('slick-initialized');
|
563
535
|
|
564
|
-
_
|
565
|
-
$(window).off('.slick'+_.instanceUid);
|
536
|
+
_.$list.off('.slick');
|
537
|
+
$(window).off('.slick-' + _.instanceUid);
|
566
538
|
};
|
567
539
|
|
568
|
-
Slick.prototype.disableTransition = function
|
540
|
+
Slick.prototype.disableTransition = function(slide) {
|
569
541
|
|
570
|
-
var _ = this
|
542
|
+
var _ = this,
|
543
|
+
transition = {};
|
544
|
+
|
545
|
+
transition[_.transitionType] = "";
|
571
546
|
|
572
547
|
if (_.options.fade === false) {
|
573
|
-
_
|
574
|
-
transition: '',
|
575
|
-
transformOrigin: ''
|
576
|
-
});
|
548
|
+
_.$slideTrack.css(transition);
|
577
549
|
} else {
|
578
|
-
|
579
|
-
transition: ''
|
580
|
-
});
|
550
|
+
_.$slides.eq(slide).css(transition);
|
581
551
|
}
|
582
552
|
|
583
553
|
};
|
584
554
|
|
585
|
-
Slick.prototype.fadeSlide = function
|
555
|
+
Slick.prototype.fadeSlide = function(slideIndex, callback) {
|
586
556
|
|
587
557
|
var _ = this;
|
588
558
|
|
589
|
-
if(_.cssTransitions === false) {
|
559
|
+
if (_.cssTransitions === false) {
|
590
560
|
|
591
|
-
|
561
|
+
_.$slides.eq(slideIndex).css({
|
562
|
+
zIndex: 1000
|
563
|
+
});
|
592
564
|
|
593
|
-
|
565
|
+
_.$slides.eq(slideIndex).animate({
|
594
566
|
opacity: 1
|
595
|
-
}, _.options.speed,_.options.easing, callback);
|
567
|
+
}, _.options.speed, _.options.easing, callback);
|
596
568
|
|
597
569
|
} else {
|
598
570
|
|
599
571
|
_.applyTransition(slideIndex);
|
600
572
|
|
601
|
-
|
573
|
+
_.$slides.eq(slideIndex).css({
|
602
574
|
opacity: 1,
|
603
575
|
zIndex: 1000
|
604
576
|
});
|
605
577
|
|
606
|
-
if(callback) {
|
607
|
-
setTimeout(function(){
|
578
|
+
if (callback) {
|
579
|
+
setTimeout(function() {
|
608
580
|
|
609
|
-
|
581
|
+
_.disableTransition(slideIndex);
|
610
582
|
|
611
|
-
|
583
|
+
callback.call();
|
612
584
|
}, _.options.speed);
|
613
585
|
}
|
614
586
|
|
@@ -616,17 +588,17 @@
|
|
616
588
|
|
617
589
|
};
|
618
590
|
|
619
|
-
Slick.prototype.filterSlides = function
|
591
|
+
Slick.prototype.filterSlides = function(filter) {
|
620
592
|
|
621
593
|
var _ = this;
|
622
594
|
|
623
|
-
if(filter !== null) {
|
595
|
+
if (filter !== null) {
|
624
596
|
|
625
597
|
_.unload();
|
626
598
|
|
627
|
-
_
|
599
|
+
_.$slideTrack.children(this.options.slide).remove();
|
628
600
|
|
629
|
-
_
|
601
|
+
_.$slidesCache.filter(filter).appendTo(_.$slideTrack);
|
630
602
|
|
631
603
|
_.reinit();
|
632
604
|
|
@@ -634,13 +606,76 @@
|
|
634
606
|
|
635
607
|
};
|
636
608
|
|
637
|
-
Slick.prototype.
|
609
|
+
Slick.prototype.getDotCount = function() {
|
610
|
+
|
611
|
+
var _ = this,
|
612
|
+
breaker = 0,
|
613
|
+
dotCounter = 0,
|
614
|
+
dotCount = 0,
|
615
|
+
dotLimit;
|
616
|
+
|
617
|
+
dotLimit = _.options.infinite === true ? _.slideCount + _.options.slidesToShow - _.options.slidesToScroll : _.slideCount;
|
618
|
+
|
619
|
+
while (breaker < dotLimit) {
|
620
|
+
dotCount++;
|
621
|
+
dotCounter += _.options.slidesToScroll;
|
622
|
+
breaker = dotCounter + _.options.slidesToShow;
|
623
|
+
}
|
624
|
+
|
625
|
+
return dotCount;
|
626
|
+
|
627
|
+
};
|
628
|
+
|
629
|
+
Slick.prototype.getLeft = function(slideIndex) {
|
630
|
+
|
631
|
+
var _ = this,
|
632
|
+
targetLeft;
|
633
|
+
|
634
|
+
_.slideOffset = 0;
|
635
|
+
|
636
|
+
if (_.options.infinite === true) {
|
637
|
+
if (_.slideCount > _.options.slidesToShow) {
|
638
|
+
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
|
639
|
+
}
|
640
|
+
if (_.slideCount % _.options.slidesToScroll !== 0) {
|
641
|
+
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
|
642
|
+
_.slideOffset = ((_.slideCount % _.options.slidesToShow) * _.slideWidth) * -1;
|
643
|
+
}
|
644
|
+
}
|
645
|
+
} else {
|
646
|
+
if (_.slideCount % _.options.slidesToShow !== 0) {
|
647
|
+
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
|
648
|
+
_.slideOffset = ((_.slideCount % _.options.slidesToShow) * _.slideWidth);
|
649
|
+
}
|
650
|
+
}
|
651
|
+
}
|
652
|
+
|
653
|
+
if (_.options.centerMode === true) {
|
654
|
+
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
|
655
|
+
}
|
656
|
+
|
657
|
+
if (_.options.vertical === false) {
|
658
|
+
targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
|
659
|
+
} else {
|
660
|
+
_.listHeight = _.$list.height();
|
661
|
+
if (_.options.infinite === true) {
|
662
|
+
targetLeft = ((slideIndex * _.listHeight) * -1) - _.listHeight;
|
663
|
+
} else {
|
664
|
+
targetLeft = ((slideIndex * _.listHeight) * -1);
|
665
|
+
}
|
666
|
+
}
|
667
|
+
|
668
|
+
return targetLeft;
|
669
|
+
|
670
|
+
};
|
671
|
+
|
672
|
+
Slick.prototype.init = function() {
|
638
673
|
|
639
674
|
var _ = this;
|
640
675
|
|
641
|
-
if (!$(_
|
676
|
+
if (!$(_.$slider).hasClass('slick-initialized')) {
|
642
677
|
|
643
|
-
$(_
|
678
|
+
$(_.$slider).addClass('slick-initialized');
|
644
679
|
_.buildOut();
|
645
680
|
_.setProps();
|
646
681
|
_.startLoad();
|
@@ -655,34 +690,34 @@
|
|
655
690
|
|
656
691
|
};
|
657
692
|
|
658
|
-
Slick.prototype.initArrowEvents = function
|
693
|
+
Slick.prototype.initArrowEvents = function() {
|
659
694
|
|
660
695
|
var _ = this;
|
661
696
|
|
662
697
|
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
663
|
-
_
|
698
|
+
_.$prevArrow.on('click.slick', {
|
664
699
|
message: 'previous'
|
665
700
|
}, _.changeSlide);
|
666
|
-
_
|
701
|
+
_.$nextArrow.on('click.slick', {
|
667
702
|
message: 'next'
|
668
703
|
}, _.changeSlide);
|
669
704
|
}
|
670
705
|
|
671
706
|
};
|
672
707
|
|
673
|
-
Slick.prototype.initDotEvents = function
|
708
|
+
Slick.prototype.initDotEvents = function() {
|
674
709
|
|
675
710
|
var _ = this;
|
676
711
|
|
677
712
|
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
678
|
-
$('li
|
713
|
+
$('li', _.$dots).on('click.slick', {
|
679
714
|
message: 'index'
|
680
715
|
}, _.changeSlide);
|
681
716
|
}
|
682
717
|
|
683
718
|
};
|
684
719
|
|
685
|
-
Slick.prototype.initializeEvents = function
|
720
|
+
Slick.prototype.initializeEvents = function() {
|
686
721
|
|
687
722
|
var _ = this;
|
688
723
|
|
@@ -690,60 +725,39 @@
|
|
690
725
|
|
691
726
|
_.initDotEvents();
|
692
727
|
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
}, _.swipeHandler);
|
710
|
-
}
|
711
|
-
|
712
|
-
if (_.options.draggable === true) {
|
713
|
-
_.list.on('mousedown.slick', {
|
714
|
-
action: 'start',
|
715
|
-
kind: 'drag'
|
716
|
-
}, _.swipeHandler);
|
717
|
-
_.list.on('mousemove.slick', {
|
718
|
-
action: 'move',
|
719
|
-
kind: 'drag'
|
720
|
-
}, _.swipeHandler);
|
721
|
-
_.list.on('mouseup.slick', {
|
722
|
-
action: 'end',
|
723
|
-
kind: 'drag'
|
724
|
-
}, _.swipeHandler);
|
725
|
-
_.list.on('mouseleave.slick', {
|
726
|
-
action: 'end',
|
727
|
-
kind: 'drag'
|
728
|
-
}, _.swipeHandler);
|
729
|
-
}
|
728
|
+
_.$list.on('touchstart.slick mousedown.slick', {
|
729
|
+
action: 'start'
|
730
|
+
}, _.swipeHandler);
|
731
|
+
_.$list.on('touchmove.slick mousemove.slick', {
|
732
|
+
action: 'move'
|
733
|
+
}, _.swipeHandler);
|
734
|
+
_.$list.on('touchend.slick mouseup.slick', {
|
735
|
+
action: 'end'
|
736
|
+
}, _.swipeHandler);
|
737
|
+
_.$list.on('touchcancel.slick mouseleave.slick', {
|
738
|
+
action: 'end'
|
739
|
+
}, _.swipeHandler);
|
740
|
+
|
741
|
+
_.$list.on('dragstart.slick', function(e) {
|
742
|
+
e.preventDefault();
|
743
|
+
});
|
730
744
|
|
731
745
|
if (_.options.pauseOnHover === true && _.options.autoplay === true) {
|
732
|
-
_
|
733
|
-
_
|
746
|
+
_.$list.on('mouseenter.slick', _.autoPlayClear);
|
747
|
+
_.$list.on('mouseleave.slick', _.autoPlay);
|
734
748
|
}
|
735
749
|
|
736
|
-
_
|
750
|
+
_.$list.on('keydown.slick', _.keyHandler);
|
737
751
|
|
738
|
-
$(window).on('orientationchange.slick.slick'+_.instanceUid, function(){
|
752
|
+
$(window).on('orientationchange.slick.slick-' + _.instanceUid, function() {
|
739
753
|
_.checkResponsive();
|
740
754
|
_.setPosition();
|
741
755
|
});
|
742
756
|
|
743
|
-
$(window).on('resize.slick.slick'+_.instanceUid, function
|
757
|
+
$(window).on('resize.slick.slick-' + _.instanceUid, function() {
|
744
758
|
if ($(window).width !== _.windowWidth) {
|
745
759
|
clearTimeout(_.windowDelay);
|
746
|
-
_.windowDelay = window.setTimeout(function
|
760
|
+
_.windowDelay = window.setTimeout(function() {
|
747
761
|
_.windowWidth = $(window).width();
|
748
762
|
_.checkResponsive();
|
749
763
|
_.setPosition();
|
@@ -751,23 +765,24 @@
|
|
751
765
|
}
|
752
766
|
});
|
753
767
|
|
754
|
-
$(window).on('load.slick.slick'+_.instanceUid, _.setPosition);
|
768
|
+
$(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
|
769
|
+
|
755
770
|
};
|
756
771
|
|
757
|
-
Slick.prototype.initUI = function
|
772
|
+
Slick.prototype.initUI = function() {
|
758
773
|
|
759
774
|
var _ = this;
|
760
775
|
|
761
776
|
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
762
777
|
|
763
|
-
_
|
764
|
-
_
|
778
|
+
_.$prevArrow.show();
|
779
|
+
_.$nextArrow.show();
|
765
780
|
|
766
781
|
}
|
767
782
|
|
768
783
|
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
769
784
|
|
770
|
-
_
|
785
|
+
_.$dots.show();
|
771
786
|
|
772
787
|
}
|
773
788
|
|
@@ -779,65 +794,74 @@
|
|
779
794
|
|
780
795
|
};
|
781
796
|
|
782
|
-
Slick.prototype.keyHandler = function
|
797
|
+
Slick.prototype.keyHandler = function(event) {
|
783
798
|
|
784
799
|
var _ = this;
|
785
800
|
|
786
801
|
if (event.keyCode === 37) {
|
787
|
-
_.changeSlide({
|
802
|
+
_.changeSlide({
|
803
|
+
data: {
|
804
|
+
message: 'previous'
|
805
|
+
}
|
806
|
+
});
|
788
807
|
} else if (event.keyCode === 39) {
|
789
|
-
_.changeSlide({
|
808
|
+
_.changeSlide({
|
809
|
+
data: {
|
810
|
+
message: 'next'
|
811
|
+
}
|
812
|
+
});
|
790
813
|
}
|
791
814
|
|
792
815
|
};
|
793
816
|
|
794
|
-
Slick.prototype.lazyLoad = function
|
817
|
+
Slick.prototype.lazyLoad = function() {
|
795
818
|
|
796
|
-
var _ = this,
|
819
|
+
var _ = this,
|
820
|
+
loadRange, cloneRange, rangeStart, rangeEnd;
|
797
821
|
|
798
822
|
if (_.options.centerMode === true) {
|
799
823
|
rangeStart = _.options.slidesToShow + _.currentSlide - 1;
|
800
824
|
rangeEnd = rangeStart + _.options.slidesToShow + 2;
|
801
825
|
} else {
|
802
|
-
rangeStart = _.options.slidesToShow + _.currentSlide;
|
826
|
+
rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
|
803
827
|
rangeEnd = rangeStart + _.options.slidesToShow;
|
804
828
|
}
|
805
829
|
|
806
|
-
loadRange = _
|
830
|
+
loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
|
807
831
|
|
808
|
-
$('img[data-lazy]',loadRange).not('[src]').each(function(){
|
832
|
+
$('img[data-lazy]', loadRange).not('[src]').each(function() {
|
809
833
|
$(this).attr('src', $(this).attr('data-lazy')).removeClass('slick-loading');
|
810
834
|
});
|
811
835
|
|
812
836
|
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
|
813
|
-
cloneRange = _
|
814
|
-
$('img[data-lazy]',cloneRange).not('[src]').each(function(){
|
837
|
+
cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
|
838
|
+
$('img[data-lazy]', cloneRange).not('[src]').each(function() {
|
815
839
|
$(this).attr('src', $(this).attr('data-lazy')).removeClass('slick-loading');
|
816
840
|
});
|
817
841
|
} else if (_.currentSlide === 0) {
|
818
|
-
cloneRange = _
|
819
|
-
$('img[data-lazy]',cloneRange).not('[src]').each(function(){
|
842
|
+
cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
|
843
|
+
$('img[data-lazy]', cloneRange).not('[src]').each(function() {
|
820
844
|
$(this).attr('src', $(this).attr('data-lazy')).removeClass('slick-loading');
|
821
845
|
});
|
822
846
|
}
|
823
847
|
|
824
848
|
};
|
825
849
|
|
826
|
-
Slick.prototype.loadSlider = function
|
850
|
+
Slick.prototype.loadSlider = function() {
|
827
851
|
|
828
852
|
var _ = this;
|
829
853
|
|
830
854
|
_.setPosition();
|
831
855
|
|
832
|
-
_
|
856
|
+
_.$slideTrack.css({
|
833
857
|
opacity: 1
|
834
858
|
});
|
835
859
|
|
836
|
-
if (document.readyState !==
|
860
|
+
if (document.readyState !== 'complete') {
|
837
861
|
|
838
|
-
$(window).load(function
|
862
|
+
$(window).load(function() {
|
839
863
|
|
840
|
-
_
|
864
|
+
_.$slider.removeClass('slick-loading');
|
841
865
|
|
842
866
|
_.initUI();
|
843
867
|
|
@@ -849,7 +873,7 @@
|
|
849
873
|
|
850
874
|
} else {
|
851
875
|
|
852
|
-
_
|
876
|
+
_.$slider.removeClass('slick-loading');
|
853
877
|
|
854
878
|
_.initUI();
|
855
879
|
|
@@ -861,7 +885,7 @@
|
|
861
885
|
|
862
886
|
};
|
863
887
|
|
864
|
-
Slick.prototype.postSlide = function
|
888
|
+
Slick.prototype.postSlide = function(index) {
|
865
889
|
|
866
890
|
var _ = this;
|
867
891
|
|
@@ -889,22 +913,23 @@
|
|
889
913
|
|
890
914
|
};
|
891
915
|
|
892
|
-
Slick.prototype.progressiveLazyLoad = function
|
916
|
+
Slick.prototype.progressiveLazyLoad = function() {
|
893
917
|
|
894
|
-
var _ = this,
|
918
|
+
var _ = this,
|
919
|
+
imgCount, targetImage;
|
895
920
|
|
896
921
|
imgCount = $('img[data-lazy]').not('[src]').length;
|
897
922
|
|
898
|
-
if(imgCount > 0) {
|
899
|
-
targetImage = $($('img[data-lazy]', _
|
900
|
-
targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function(){
|
923
|
+
if (imgCount > 0) {
|
924
|
+
targetImage = $($('img[data-lazy]', _.$slider).not('[src]').get(0));
|
925
|
+
targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
|
901
926
|
_.progressiveLazyLoad();
|
902
927
|
});
|
903
928
|
}
|
904
929
|
|
905
930
|
};
|
906
931
|
|
907
|
-
Slick.prototype.refresh = function
|
932
|
+
Slick.prototype.refresh = function() {
|
908
933
|
|
909
934
|
var _ = this;
|
910
935
|
|
@@ -916,24 +941,22 @@
|
|
916
941
|
|
917
942
|
};
|
918
943
|
|
919
|
-
Slick.prototype.reinit = function
|
944
|
+
Slick.prototype.reinit = function() {
|
920
945
|
|
921
946
|
var _ = this;
|
922
947
|
|
923
|
-
_
|
924
|
-
':not(.slick-cloned)', _
|
948
|
+
_.$slides = $(_.options.slide +
|
949
|
+
':not(.slick-cloned)', _.$slideTrack).addClass(
|
925
950
|
'slick-slide');
|
926
951
|
|
927
|
-
_.slideCount = _
|
952
|
+
_.slideCount = _.$slides.length;
|
928
953
|
|
929
|
-
if(_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
|
954
|
+
if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
|
930
955
|
_.currentSlide = _.currentSlide - _.options.slidesToScroll;
|
931
956
|
}
|
932
957
|
|
933
958
|
_.setProps();
|
934
959
|
|
935
|
-
_.setupPlaceholders();
|
936
|
-
|
937
960
|
_.setupInfinite();
|
938
961
|
|
939
962
|
_.buildArrows();
|
@@ -958,55 +981,39 @@
|
|
958
981
|
|
959
982
|
};
|
960
983
|
|
961
|
-
Slick.prototype.removeSlide = function
|
984
|
+
Slick.prototype.removeSlide = function(index, removeBefore) {
|
962
985
|
|
963
986
|
var _ = this;
|
964
987
|
|
965
|
-
if (typeof(index) ===
|
988
|
+
if (typeof(index) === 'boolean') {
|
966
989
|
removeBefore = index;
|
967
|
-
index =
|
968
|
-
}
|
969
|
-
|
970
|
-
_.unload();
|
971
|
-
|
972
|
-
if (_.slideCount < 1) {
|
973
|
-
return false;
|
974
|
-
}
|
975
|
-
|
976
|
-
if (typeof(index) === "number") {
|
977
|
-
if (removeBefore === true) {
|
978
|
-
--index;
|
979
|
-
} else if (removeBefore === false) {
|
980
|
-
++index;
|
981
|
-
}
|
990
|
+
index = removeBefore === true ? 0 : _.slideCount - 1;
|
982
991
|
} else {
|
983
|
-
|
984
|
-
index = 0;
|
985
|
-
} else {
|
986
|
-
index = $(_.slideTrack.children(this.options.slide)).length - 1;
|
987
|
-
}
|
992
|
+
index = removeBefore === true ? --index : index;
|
988
993
|
}
|
989
994
|
|
990
|
-
if (index < 0 || index
|
991
|
-
_.reinit();
|
995
|
+
if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
|
992
996
|
return false;
|
993
997
|
}
|
994
998
|
|
995
|
-
|
999
|
+
_.unload();
|
1000
|
+
|
1001
|
+
_.$slideTrack.children(this.options.slide).eq(index).remove();
|
996
1002
|
|
997
|
-
_
|
1003
|
+
_.$slides = _.$slideTrack.children(this.options.slide);
|
998
1004
|
|
999
|
-
_
|
1005
|
+
_.$slideTrack.children(this.options.slide).remove();
|
1000
1006
|
|
1001
|
-
_
|
1007
|
+
_.$slideTrack.append(_.$slides);
|
1002
1008
|
|
1003
1009
|
_.reinit();
|
1004
1010
|
|
1005
1011
|
};
|
1006
1012
|
|
1007
|
-
Slick.prototype.setCSS = function
|
1013
|
+
Slick.prototype.setCSS = function(position) {
|
1008
1014
|
|
1009
|
-
var _ = this,
|
1015
|
+
var _ = this,
|
1016
|
+
positionProps = {}, x, y;
|
1010
1017
|
|
1011
1018
|
x = _.positionProp == 'left' ? position + 'px' : '0px';
|
1012
1019
|
y = _.positionProp == 'top' ? position + 'px' : '0px';
|
@@ -1014,53 +1021,58 @@
|
|
1014
1021
|
positionProps[_.positionProp] = position;
|
1015
1022
|
|
1016
1023
|
if (_.transformsEnabled === false) {
|
1017
|
-
_
|
1024
|
+
_.$slideTrack.css(positionProps);
|
1018
1025
|
} else {
|
1019
1026
|
positionProps = {};
|
1020
|
-
if(_.cssTransitions === false) {
|
1021
|
-
positionProps[_.animType] =
|
1022
|
-
_
|
1027
|
+
if (_.cssTransitions === false) {
|
1028
|
+
positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
|
1029
|
+
_.$slideTrack.css(positionProps);
|
1023
1030
|
} else {
|
1024
|
-
positionProps[_.animType] =
|
1025
|
-
_
|
1031
|
+
positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
|
1032
|
+
_.$slideTrack.css(positionProps);
|
1026
1033
|
}
|
1027
1034
|
}
|
1028
1035
|
|
1029
1036
|
};
|
1030
1037
|
|
1031
|
-
Slick.prototype.setDimensions = function
|
1038
|
+
Slick.prototype.setDimensions = function() {
|
1032
1039
|
|
1033
1040
|
var _ = this;
|
1034
1041
|
|
1035
|
-
if(_.options.centerMode === true) {
|
1036
|
-
_
|
1042
|
+
if (_.options.centerMode === true) {
|
1043
|
+
_.$list.find('.slick-slide').width(_.slideWidth);
|
1037
1044
|
} else {
|
1038
|
-
_
|
1045
|
+
_.$list.find('.slick-slide').width(_.slideWidth);
|
1039
1046
|
}
|
1040
1047
|
|
1041
1048
|
|
1042
1049
|
if (_.options.vertical === false) {
|
1043
|
-
_
|
1044
|
-
|
1045
|
-
if(_.options.centerMode ===
|
1046
|
-
_
|
1050
|
+
_.$slideTrack.width(Math.ceil((_.slideWidth * _
|
1051
|
+
.$slider.find('.slick-slide').length)));
|
1052
|
+
if (_.options.centerMode === true) {
|
1053
|
+
_.$list.css({
|
1054
|
+
padding: ('0px ' + _.options.centerPadding)
|
1055
|
+
});
|
1047
1056
|
}
|
1048
1057
|
} else {
|
1049
|
-
_
|
1050
|
-
_
|
1051
|
-
|
1052
|
-
|
1053
|
-
_
|
1058
|
+
_.$list.height(_.$slides.first().outerHeight());
|
1059
|
+
_.$slideTrack.height(Math.ceil((_.listHeight * _
|
1060
|
+
.$slider.find('.slick-slide').length)));
|
1061
|
+
if (_.options.centerMode === true) {
|
1062
|
+
_.$list.css({
|
1063
|
+
padding: (_.options.centerPadding + ' 0px')
|
1064
|
+
});
|
1054
1065
|
}
|
1055
1066
|
}
|
1056
1067
|
|
1057
1068
|
};
|
1058
1069
|
|
1059
|
-
Slick.prototype.setFade = function
|
1070
|
+
Slick.prototype.setFade = function() {
|
1060
1071
|
|
1061
|
-
var _ = this,
|
1072
|
+
var _ = this,
|
1073
|
+
targetLeft;
|
1062
1074
|
|
1063
|
-
_
|
1075
|
+
_.$slides.each(function(index, element) {
|
1064
1076
|
targetLeft = (_.slideWidth * index) * -1;
|
1065
1077
|
$(element).css({
|
1066
1078
|
position: 'relative',
|
@@ -1071,122 +1083,108 @@
|
|
1071
1083
|
});
|
1072
1084
|
});
|
1073
1085
|
|
1074
|
-
|
1086
|
+
_.$slides.eq(_.currentSlide).css({
|
1075
1087
|
zIndex: 900,
|
1076
1088
|
opacity: 1
|
1077
1089
|
});
|
1078
1090
|
|
1079
1091
|
};
|
1080
1092
|
|
1081
|
-
Slick.prototype.setPosition = function
|
1093
|
+
Slick.prototype.setPosition = function() {
|
1082
1094
|
|
1083
|
-
var _ = this
|
1084
|
-
|
1085
|
-
targetSlide = _.currentSlide;
|
1095
|
+
var _ = this;
|
1086
1096
|
|
1087
1097
|
_.setValues();
|
1088
1098
|
_.setDimensions();
|
1089
1099
|
|
1090
|
-
_.slideOffset = 0;
|
1091
|
-
|
1092
|
-
if (_.options.infinite === true) {
|
1093
|
-
if(_.slideCount > _.options.slidesToShow) {
|
1094
|
-
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
|
1095
|
-
}
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
if (_.options.centerMode === true) {
|
1099
|
-
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
|
1100
|
-
}
|
1101
|
-
|
1102
|
-
if (_.options.placeholders === false) {
|
1103
|
-
if(_.currentSlide + _.options.slidesToScroll >= _.slideCount - _.options.slidesToScroll) {
|
1104
|
-
_.slideOffset = _.slideOffset - ((_.slideWidth * _.placeholderOffset) * -1);
|
1105
|
-
}
|
1106
|
-
}
|
1107
|
-
|
1108
1100
|
if (_.options.fade === false) {
|
1109
|
-
|
1110
|
-
targetPosition = ((targetSlide *
|
1111
|
-
_.slideWidth) * -1) + _.slideOffset;
|
1112
|
-
} else {
|
1113
|
-
targetPosition = ((targetSlide *
|
1114
|
-
_.listHeight) * -1) - _.listHeight;
|
1115
|
-
}
|
1116
|
-
_.setCSS(targetPosition);
|
1101
|
+
_.setCSS(_.getLeft(_.currentSlide));
|
1117
1102
|
} else {
|
1118
1103
|
_.setFade();
|
1119
1104
|
}
|
1120
1105
|
|
1121
1106
|
};
|
1122
1107
|
|
1123
|
-
Slick.prototype.setProps = function
|
1108
|
+
Slick.prototype.setProps = function() {
|
1124
1109
|
|
1125
1110
|
var _ = this;
|
1126
1111
|
|
1127
1112
|
_.positionProp = _.options.vertical === true ? 'top' : 'left';
|
1128
1113
|
|
1129
1114
|
if (_.positionProp === 'top') {
|
1130
|
-
_
|
1115
|
+
_.$slider.addClass('slick-vertical');
|
1131
1116
|
} else {
|
1132
|
-
_
|
1117
|
+
_.$slider.removeClass('slick-vertical');
|
1133
1118
|
}
|
1134
1119
|
|
1135
|
-
if (
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1120
|
+
if (document.body.style.WebkitTransition !== undefined ||
|
1121
|
+
document.body.style.MozTransition !== undefined ||
|
1122
|
+
document.body.style.msTransition !== undefined) {
|
1123
|
+
_.cssTransitions = true;
|
1139
1124
|
}
|
1140
1125
|
|
1141
|
-
if (document.body.style.MozTransform !== undefined)
|
1142
|
-
|
1143
|
-
|
1126
|
+
if (document.body.style.MozTransform !== undefined) {
|
1127
|
+
_.animType = 'MozTransform';
|
1128
|
+
_.transformType = "-moz-transform";
|
1129
|
+
_.transitionType = 'MozTransition';
|
1130
|
+
}
|
1131
|
+
if (document.body.style.webkitTransform !== undefined) {
|
1132
|
+
_.animType = 'webkitTransform';
|
1133
|
+
_.transformType = "-webkit-transform";
|
1134
|
+
_.transitionType = 'webkitTransition';
|
1135
|
+
}
|
1136
|
+
if (document.body.style.msTransform !== undefined) {
|
1137
|
+
_.animType = 'transform';
|
1138
|
+
_.transformType = "transform";
|
1139
|
+
_.transitionType = 'transition';
|
1140
|
+
}
|
1144
1141
|
|
1145
1142
|
_.transformsEnabled = (_.animType !== null);
|
1146
1143
|
|
1147
1144
|
};
|
1148
1145
|
|
1149
|
-
Slick.prototype.setValues = function
|
1146
|
+
Slick.prototype.setValues = function() {
|
1150
1147
|
|
1151
1148
|
var _ = this;
|
1152
1149
|
|
1153
|
-
_.listWidth = _
|
1154
|
-
_.listHeight = _
|
1150
|
+
_.listWidth = _.$list.width();
|
1151
|
+
_.listHeight = _.$list.height();
|
1155
1152
|
_.slideWidth = Math.ceil(_.listWidth / _.options
|
1156
1153
|
.slidesToShow);
|
1157
1154
|
|
1158
1155
|
};
|
1159
1156
|
|
1160
|
-
Slick.prototype.setSlideClasses = function
|
1157
|
+
Slick.prototype.setSlideClasses = function(index) {
|
1161
1158
|
|
1162
|
-
var _ = this,
|
1159
|
+
var _ = this,
|
1160
|
+
centerOffset, allSlides, indexOffset;
|
1163
1161
|
|
1164
|
-
_
|
1165
|
-
allSlides = _
|
1162
|
+
_.$slider.find('.slick-slide').removeClass('slick-active').removeClass('slick-center');
|
1163
|
+
allSlides = _.$slider.find('.slick-slide');
|
1166
1164
|
|
1167
1165
|
if (_.options.centerMode === true) {
|
1168
1166
|
|
1169
1167
|
centerOffset = Math.floor(_.options.slidesToShow / 2);
|
1170
1168
|
|
1171
|
-
if(index >= centerOffset && index <= (_.slideCount - 1) -
|
1172
|
-
_
|
1169
|
+
if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
|
1170
|
+
_.$slides.slice(index - centerOffset, index + centerOffset + 1).addClass('slick-active');
|
1173
1171
|
} else {
|
1174
1172
|
indexOffset = _.options.slidesToShow + index;
|
1175
1173
|
allSlides.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2).addClass('slick-active');
|
1176
1174
|
}
|
1177
1175
|
|
1178
|
-
if(index === 0) {
|
1179
|
-
|
1176
|
+
if (index === 0) {
|
1177
|
+
allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass('slick-center');
|
1180
1178
|
} else if (index === _.slideCount - 1) {
|
1181
|
-
|
1179
|
+
allSlides.eq(_.options.slidesToShow).addClass('slick-center');
|
1182
1180
|
}
|
1183
1181
|
|
1184
|
-
|
1182
|
+
_.$slides.eq(index).addClass('slick-center');
|
1185
1183
|
|
1186
1184
|
} else {
|
1187
1185
|
|
1188
|
-
if(index > 0 && index < (_.slideCount - _.options.slidesToShow)) {
|
1189
|
-
_
|
1186
|
+
if (index > 0 && index < (_.slideCount - _.options.slidesToShow)) {
|
1187
|
+
_.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active');
|
1190
1188
|
} else {
|
1191
1189
|
indexOffset = _.options.slidesToShow + index;
|
1192
1190
|
allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active');
|
@@ -1200,9 +1198,16 @@
|
|
1200
1198
|
|
1201
1199
|
};
|
1202
1200
|
|
1203
|
-
Slick.prototype.setupInfinite = function
|
1201
|
+
Slick.prototype.setupInfinite = function() {
|
1202
|
+
|
1203
|
+
var _ = this,
|
1204
|
+
i, slideIndex, infiniteCount;
|
1204
1205
|
|
1205
|
-
|
1206
|
+
if (_.options.fade === true || _.options.vertical === true) {
|
1207
|
+
_.options.slidesToShow = 1;
|
1208
|
+
_.options.slidesToScroll = 1;
|
1209
|
+
_.options.centerMode = false;
|
1210
|
+
}
|
1206
1211
|
|
1207
1212
|
if (_.options.infinite === true && _.options.fade === false) {
|
1208
1213
|
|
@@ -1210,7 +1215,7 @@
|
|
1210
1215
|
|
1211
1216
|
if (_.slideCount > _.options.slidesToShow) {
|
1212
1217
|
|
1213
|
-
if(_.options.centerMode === true) {
|
1218
|
+
if (_.options.centerMode === true) {
|
1214
1219
|
infiniteCount = _.options.slidesToShow + 1;
|
1215
1220
|
} else {
|
1216
1221
|
infiniteCount = _.options.slidesToShow;
|
@@ -1219,14 +1224,17 @@
|
|
1219
1224
|
for (i = _.slideCount; i > (_.slideCount -
|
1220
1225
|
infiniteCount); i -= 1) {
|
1221
1226
|
slideIndex = i - 1;
|
1222
|
-
$(_
|
1223
|
-
_
|
1227
|
+
$(_.$slides[slideIndex]).clone().attr('id', '').prependTo(
|
1228
|
+
_.$slideTrack).addClass('slick-cloned');
|
1224
1229
|
}
|
1225
1230
|
for (i = 0; i < infiniteCount; i += 1) {
|
1226
1231
|
slideIndex = i;
|
1227
|
-
$(_
|
1228
|
-
_
|
1232
|
+
$(_.$slides[slideIndex]).clone().attr('id', '').appendTo(
|
1233
|
+
_.$slideTrack).addClass('slick-cloned');
|
1229
1234
|
}
|
1235
|
+
_.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
|
1236
|
+
$(this).attr('id', '');
|
1237
|
+
});
|
1230
1238
|
|
1231
1239
|
}
|
1232
1240
|
|
@@ -1234,75 +1242,22 @@
|
|
1234
1242
|
|
1235
1243
|
};
|
1236
1244
|
|
1237
|
-
Slick.prototype.
|
1238
|
-
|
1239
|
-
var _ = this, i, placeholders;
|
1240
|
-
|
1241
|
-
if(_.options.fade === true || _.options.vertical === true) {
|
1242
|
-
_.options.slidesToShow = 1;
|
1243
|
-
_.options.slidesToScroll = 1;
|
1244
|
-
_.options.centerMode = false;
|
1245
|
-
}
|
1246
|
-
|
1247
|
-
if(_.options.placeholders === false) {
|
1248
|
-
_.options.infinite = false;
|
1249
|
-
_.placeholderOffset = _.slideCount % _.options.slidesToScroll;
|
1250
|
-
return false;
|
1251
|
-
}
|
1252
|
-
|
1253
|
-
if ((_.slideCount % _.options.slidesToScroll) !==
|
1254
|
-
0 && _.slideCount > _.options.slidesToShow) {
|
1255
|
-
|
1256
|
-
placeholders = Math.abs(_.options.slidesToScroll -
|
1257
|
-
(_.slideCount % _.options.slidesToScroll)
|
1258
|
-
);
|
1259
|
-
for (i = 0; i < placeholders; i += 1) {
|
1260
|
-
$('<div/>').appendTo(_.slideTrack).addClass(
|
1261
|
-
'slick-slide slick-placeholder');
|
1262
|
-
}
|
1263
|
-
_.slides = $('.slick-slide:not(.slick-cloned)',
|
1264
|
-
_.slider);
|
1265
|
-
_.slideCount = _.slides.length;
|
1266
|
-
}
|
1267
|
-
|
1268
|
-
};
|
1269
|
-
|
1270
|
-
Slick.prototype.slideHandler = function (index) {
|
1245
|
+
Slick.prototype.slideHandler = function(index) {
|
1271
1246
|
|
1272
1247
|
var targetSlide, animSlide, slideLeft, targetLeft = null,
|
1273
|
-
|
1248
|
+
_ = this;
|
1274
1249
|
|
1275
|
-
if(_.animating === true) {
|
1250
|
+
if (_.animating === true) {
|
1276
1251
|
return false;
|
1277
1252
|
}
|
1278
1253
|
|
1279
1254
|
targetSlide = index;
|
1280
|
-
|
1255
|
+
targetLeft = _.getLeft(targetSlide);
|
1256
|
+
slideLeft = _.getLeft(_.currentSlide);
|
1281
1257
|
|
1282
|
-
if(_.options.
|
1283
|
-
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
|
1284
|
-
if (targetSlide >= _.slideCount - _.options.slidesToShow) {
|
1285
|
-
targetSlide = _.currentSlide;
|
1286
|
-
} else {
|
1287
|
-
targetOffset = 0;
|
1288
|
-
}
|
1289
|
-
} else if (targetSlide + _.options.slidesToScroll >= _.slideCount -
|
1290
|
-
_.options.slidesToScroll) {
|
1291
|
-
targetOffset = ((_.placeholderOffset * _.slideWidth));
|
1292
|
-
}
|
1293
|
-
}
|
1294
|
-
|
1295
|
-
if(_.options.vertical === false) {
|
1296
|
-
targetLeft = ((targetSlide * _.slideWidth) * -1) + targetOffset;
|
1297
|
-
slideLeft = ((_.currentSlide * _.slideWidth) * -1) + targetOffset;
|
1298
|
-
} else {
|
1299
|
-
targetLeft = ((targetSlide * _.listHeight) * -1) - _.listHeight;
|
1300
|
-
slideLeft = ((_.currentSlide * _.listHeight) * -1) - _.listHeight;
|
1301
|
-
}
|
1302
|
-
|
1303
|
-
if (_.options.infinite === false && (index < 0 || index > (_.slideCount -1))) {
|
1258
|
+
if (_.options.infinite === false && (index < 0 || index > (_.slideCount - _.options.slidesToShow))) {
|
1304
1259
|
targetSlide = _.currentSlide;
|
1305
|
-
_.animateSlide(slideLeft, function
|
1260
|
+
_.animateSlide(slideLeft, function() {
|
1306
1261
|
_.postSlide(targetSlide);
|
1307
1262
|
});
|
1308
1263
|
return false;
|
@@ -1315,7 +1270,11 @@
|
|
1315
1270
|
_.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
|
1316
1271
|
|
1317
1272
|
if (targetSlide < 0) {
|
1318
|
-
|
1273
|
+
if (_.slideCount % _.options.slidesToScroll !== 0) {
|
1274
|
+
animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
|
1275
|
+
} else {
|
1276
|
+
animSlide = _.slideCount - _.options.slidesToScroll;
|
1277
|
+
}
|
1319
1278
|
} else if (targetSlide > (_.slideCount - 1)) {
|
1320
1279
|
animSlide = 0;
|
1321
1280
|
} else {
|
@@ -1329,39 +1288,40 @@
|
|
1329
1288
|
}
|
1330
1289
|
|
1331
1290
|
if (_.options.fade === true) {
|
1332
|
-
_.fadeSlide(animSlide, function(){
|
1291
|
+
_.fadeSlide(animSlide, function() {
|
1333
1292
|
_.postSlide(animSlide);
|
1334
1293
|
});
|
1335
1294
|
return false;
|
1336
1295
|
}
|
1337
|
-
|
1296
|
+
|
1297
|
+
_.animateSlide(targetLeft, function() {
|
1338
1298
|
_.postSlide(animSlide);
|
1339
1299
|
});
|
1340
1300
|
|
1341
1301
|
};
|
1342
1302
|
|
1343
|
-
Slick.prototype.startLoad = function
|
1303
|
+
Slick.prototype.startLoad = function() {
|
1344
1304
|
|
1345
1305
|
var _ = this;
|
1346
1306
|
|
1347
1307
|
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
1348
1308
|
|
1349
|
-
_
|
1350
|
-
_
|
1309
|
+
_.$prevArrow.hide();
|
1310
|
+
_.$nextArrow.hide();
|
1351
1311
|
|
1352
1312
|
}
|
1353
1313
|
|
1354
1314
|
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
1355
1315
|
|
1356
|
-
_
|
1316
|
+
_.$dots.hide();
|
1357
1317
|
|
1358
1318
|
}
|
1359
1319
|
|
1360
|
-
_
|
1320
|
+
_.$slider.addClass('slick-loading');
|
1361
1321
|
|
1362
1322
|
};
|
1363
1323
|
|
1364
|
-
Slick.prototype.swipeDirection = function
|
1324
|
+
Slick.prototype.swipeDirection = function() {
|
1365
1325
|
|
1366
1326
|
var xDist, yDist, r, swipeAngle, _ = this;
|
1367
1327
|
|
@@ -1388,40 +1348,35 @@
|
|
1388
1348
|
|
1389
1349
|
};
|
1390
1350
|
|
1391
|
-
Slick.prototype.swipeEnd = function
|
1351
|
+
Slick.prototype.swipeEnd = function(event) {
|
1392
1352
|
|
1393
1353
|
var _ = this;
|
1394
1354
|
|
1395
|
-
_
|
1396
|
-
|
1397
|
-
if(_.touchObject.curX === undefined) {
|
1398
|
-
return false;
|
1399
|
-
}
|
1355
|
+
_.$list.removeClass('dragging');
|
1400
1356
|
|
1401
|
-
if (
|
1402
|
-
_.touchObject = {};
|
1357
|
+
if (_.touchObject.curX === undefined) {
|
1403
1358
|
return false;
|
1404
1359
|
}
|
1405
1360
|
|
1406
1361
|
if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
|
1407
1362
|
|
1408
|
-
$(event.target).on(
|
1363
|
+
$(event.target).on('click.slick', function(event) {
|
1409
1364
|
event.stopImmediatePropagation();
|
1410
1365
|
event.stopPropagation();
|
1411
1366
|
event.preventDefault();
|
1412
|
-
$(event.target).off(
|
1367
|
+
$(event.target).off('click.slick');
|
1413
1368
|
});
|
1414
1369
|
|
1415
1370
|
switch (_.swipeDirection()) {
|
1416
1371
|
case 'left':
|
1417
1372
|
_.slideHandler(_.currentSlide + _.options.slidesToScroll);
|
1418
1373
|
_.touchObject = {};
|
1419
|
-
|
1374
|
+
break;
|
1420
1375
|
|
1421
1376
|
case 'right':
|
1422
1377
|
_.slideHandler(_.currentSlide - _.options.slidesToScroll);
|
1423
1378
|
_.touchObject = {};
|
1424
|
-
|
1379
|
+
break;
|
1425
1380
|
}
|
1426
1381
|
|
1427
1382
|
} else {
|
@@ -1431,53 +1386,50 @@
|
|
1431
1386
|
|
1432
1387
|
};
|
1433
1388
|
|
1434
|
-
Slick.prototype.swipeHandler = function
|
1389
|
+
Slick.prototype.swipeHandler = function(event) {
|
1435
1390
|
|
1436
1391
|
var _ = this;
|
1437
1392
|
|
1438
|
-
if(event.originalEvent
|
1439
|
-
|
1440
|
-
|
1393
|
+
if (event.originalEvent && event.originalEvent.touches && _.options.swipe === false) {
|
1394
|
+
return false;
|
1395
|
+
} else if (_.options.draggable === false) {
|
1396
|
+
return false;
|
1441
1397
|
}
|
1442
1398
|
|
1399
|
+
_.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
|
1400
|
+
event.originalEvent.touches.length : 1;
|
1401
|
+
|
1443
1402
|
_.touchObject.minSwipe = _.listWidth / _.options
|
1444
1403
|
.touchThreshold;
|
1445
1404
|
|
1446
1405
|
switch (event.data.action) {
|
1447
1406
|
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1407
|
+
case 'start':
|
1408
|
+
_.swipeStart(event);
|
1409
|
+
break;
|
1451
1410
|
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1411
|
+
case 'move':
|
1412
|
+
_.swipeMove(event);
|
1413
|
+
break;
|
1455
1414
|
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1415
|
+
case 'end':
|
1416
|
+
_.swipeEnd(event);
|
1417
|
+
break;
|
1459
1418
|
|
1460
1419
|
}
|
1461
1420
|
|
1462
1421
|
};
|
1463
1422
|
|
1464
|
-
Slick.prototype.swipeMove = function
|
1423
|
+
Slick.prototype.swipeMove = function(event) {
|
1465
1424
|
|
1466
|
-
var _ = this,
|
1425
|
+
var _ = this,
|
1426
|
+
curLeft, swipeDirection, positionOffset, touches;
|
1467
1427
|
|
1468
1428
|
touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
|
1469
1429
|
|
1470
|
-
curLeft = _.
|
1471
|
-
_.slideOffset : ((_.currentSlide * _.listHeight) * -1) -
|
1472
|
-
_.listHeight;
|
1473
|
-
|
1474
|
-
if (_.options.placeholders === false && _.currentSlide +
|
1475
|
-
_.options.slidesToShow >= _.slideCount) {
|
1476
|
-
curLeft = ((_.currentSlide * _.slideWidth) * -1) + _.slideOffset;
|
1477
|
-
}
|
1430
|
+
curLeft = _.getLeft(_.currentSlide);
|
1478
1431
|
|
1479
|
-
if(
|
1480
|
-
touches && touches.length !== 1){
|
1432
|
+
if (!_.$list.hasClass('dragging') || touches && touches.length !== 1) {
|
1481
1433
|
return false;
|
1482
1434
|
}
|
1483
1435
|
|
@@ -1493,20 +1445,20 @@
|
|
1493
1445
|
return false;
|
1494
1446
|
}
|
1495
1447
|
|
1496
|
-
if(event.originalEvent !== undefined) {
|
1448
|
+
if (event.originalEvent !== undefined) {
|
1497
1449
|
event.preventDefault();
|
1498
1450
|
}
|
1499
1451
|
|
1500
1452
|
positionOffset = _.touchObject.curX > _.touchObject.startX ? 1 : -1;
|
1501
1453
|
|
1502
|
-
if(_.options.vertical === false) {
|
1454
|
+
if (_.options.vertical === false) {
|
1503
1455
|
_.swipeLeft = curLeft + _.touchObject.swipeLength * positionOffset;
|
1504
1456
|
} else {
|
1505
1457
|
_.swipeLeft = curLeft + (_.touchObject
|
1506
|
-
|
1458
|
+
.swipeLength * (_.listHeight / _.listWidth)) * positionOffset;
|
1507
1459
|
}
|
1508
1460
|
|
1509
|
-
if(_.options.fade === true || _.options.touchMove === false) {
|
1461
|
+
if (_.options.fade === true || _.options.touchMove === false) {
|
1510
1462
|
return false;
|
1511
1463
|
}
|
1512
1464
|
|
@@ -1519,37 +1471,38 @@
|
|
1519
1471
|
|
1520
1472
|
};
|
1521
1473
|
|
1522
|
-
Slick.prototype.swipeStart = function
|
1474
|
+
Slick.prototype.swipeStart = function(event) {
|
1523
1475
|
|
1524
|
-
var _ = this,
|
1476
|
+
var _ = this,
|
1477
|
+
touches;
|
1525
1478
|
|
1526
1479
|
if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
|
1527
1480
|
_.touchObject = {};
|
1528
1481
|
return false;
|
1529
1482
|
}
|
1530
1483
|
|
1531
|
-
if(event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
|
1484
|
+
if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
|
1532
1485
|
touches = event.originalEvent.touches[0];
|
1533
1486
|
}
|
1534
1487
|
|
1535
1488
|
_.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
|
1536
1489
|
_.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
|
1537
1490
|
|
1538
|
-
_
|
1491
|
+
_.$list.addClass('dragging');
|
1539
1492
|
|
1540
1493
|
};
|
1541
1494
|
|
1542
|
-
Slick.prototype.unfilterSlides = function
|
1495
|
+
Slick.prototype.unfilterSlides = function() {
|
1543
1496
|
|
1544
1497
|
var _ = this;
|
1545
1498
|
|
1546
|
-
if(_
|
1499
|
+
if (_.$slidesCache !== null) {
|
1547
1500
|
|
1548
1501
|
_.unload();
|
1549
1502
|
|
1550
|
-
_
|
1503
|
+
_.$slideTrack.children(this.options.slide).remove();
|
1551
1504
|
|
1552
|
-
_
|
1505
|
+
_.$slidesCache.appendTo(_.$slideTrack);
|
1553
1506
|
|
1554
1507
|
_.reinit();
|
1555
1508
|
|
@@ -1557,173 +1510,173 @@
|
|
1557
1510
|
|
1558
1511
|
};
|
1559
1512
|
|
1560
|
-
Slick.prototype.unload = function
|
1513
|
+
Slick.prototype.unload = function() {
|
1561
1514
|
|
1562
1515
|
var _ = this;
|
1563
1516
|
|
1564
|
-
$('.slick-cloned', _
|
1565
|
-
|
1566
|
-
|
1567
|
-
_.dots.remove();
|
1517
|
+
$('.slick-cloned', _.$slider).remove();
|
1518
|
+
if (_.$dots) {
|
1519
|
+
_.$dots.remove();
|
1568
1520
|
}
|
1569
|
-
if (_
|
1570
|
-
_
|
1571
|
-
_
|
1521
|
+
if (_.$prevArrow) {
|
1522
|
+
_.$prevArrow.remove();
|
1523
|
+
_.$nextArrow.remove();
|
1572
1524
|
}
|
1573
|
-
_
|
1525
|
+
_.$slides.removeClass(
|
1574
1526
|
'slick-slide slick-active slick-visible').removeAttr('style');
|
1575
1527
|
|
1576
1528
|
};
|
1577
1529
|
|
1578
|
-
Slick.prototype.updateArrows = function
|
1530
|
+
Slick.prototype.updateArrows = function() {
|
1579
1531
|
|
1580
1532
|
var _ = this;
|
1581
1533
|
|
1582
1534
|
if (_.options.arrows === true && _.options.infinite !==
|
1583
1535
|
true && _.slideCount > _.options.slidesToShow) {
|
1536
|
+
_.$prevArrow.removeClass('slick-disabled');
|
1537
|
+
_.$nextArrow.removeClass('slick-disabled');
|
1584
1538
|
if (_.currentSlide === 0) {
|
1585
|
-
_
|
1586
|
-
_
|
1587
|
-
} else if (_.currentSlide >=
|
1588
|
-
_.
|
1589
|
-
|
1590
|
-
_.nextArrow.addClass('slick-disabled');
|
1591
|
-
_.prevArrow.removeClass('slick-disabled');
|
1592
|
-
} else if (_.options.placeholders === false && _.currentSlide +
|
1593
|
-
_.options.slidesToShow >= _.slideCount) {
|
1594
|
-
_.nextArrow.addClass('slick-disabled');
|
1595
|
-
_.prevArrow.removeClass('slick-disabled');
|
1596
|
-
} else {
|
1597
|
-
_.prevArrow.removeClass('slick-disabled');
|
1598
|
-
_.nextArrow.removeClass('slick-disabled');
|
1539
|
+
_.$prevArrow.addClass('slick-disabled');
|
1540
|
+
_.$nextArrow.removeClass('slick-disabled');
|
1541
|
+
} else if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
|
1542
|
+
_.$nextArrow.addClass('slick-disabled');
|
1543
|
+
_.$prevArrow.removeClass('slick-disabled');
|
1599
1544
|
}
|
1600
1545
|
}
|
1601
1546
|
|
1602
1547
|
};
|
1603
1548
|
|
1604
|
-
Slick.prototype.updateDots = function
|
1549
|
+
Slick.prototype.updateDots = function() {
|
1605
1550
|
|
1606
1551
|
var _ = this;
|
1607
1552
|
|
1608
|
-
if(_
|
1553
|
+
if (_.$dots !== null) {
|
1609
1554
|
|
1610
|
-
_
|
1611
|
-
|
1555
|
+
_.$dots.find('li').removeClass('slick-active');
|
1556
|
+
_.$dots.find('li').eq(_.currentSlide / _.options.slidesToScroll).addClass(
|
1612
1557
|
'slick-active');
|
1613
1558
|
|
1614
1559
|
}
|
1615
1560
|
|
1616
1561
|
};
|
1617
1562
|
|
1618
|
-
$.fn.slick = function
|
1563
|
+
$.fn.slick = function(options) {
|
1619
1564
|
var _ = this;
|
1620
|
-
return _.each(function
|
1565
|
+
return _.each(function(index, element) {
|
1621
1566
|
|
1622
1567
|
element.slick = new Slick(element, options);
|
1623
1568
|
|
1624
1569
|
});
|
1625
1570
|
};
|
1626
1571
|
|
1627
|
-
$.fn.slickAdd = function
|
1572
|
+
$.fn.slickAdd = function(slide, slideIndex, addBefore) {
|
1628
1573
|
var _ = this;
|
1629
|
-
return _.each(function
|
1574
|
+
return _.each(function(index, element) {
|
1630
1575
|
|
1631
|
-
|
1576
|
+
element.slick.addSlide(slide, slideIndex, addBefore);
|
1632
1577
|
|
1633
1578
|
});
|
1634
1579
|
};
|
1635
1580
|
|
1636
|
-
$.fn.slickFilter = function
|
1581
|
+
$.fn.slickFilter = function(filter) {
|
1637
1582
|
var _ = this;
|
1638
|
-
return _.each(function
|
1583
|
+
return _.each(function(index, element) {
|
1639
1584
|
|
1640
|
-
|
1585
|
+
element.slick.filterSlides(filter);
|
1641
1586
|
|
1642
1587
|
});
|
1643
1588
|
};
|
1644
1589
|
|
1645
|
-
$.fn.slickGoTo = function
|
1590
|
+
$.fn.slickGoTo = function(slide) {
|
1646
1591
|
var _ = this;
|
1647
|
-
return _.each(function
|
1592
|
+
return _.each(function(index, element) {
|
1648
1593
|
|
1649
|
-
|
1594
|
+
element.slick.slideHandler(slide);
|
1650
1595
|
|
1651
1596
|
});
|
1652
1597
|
};
|
1653
1598
|
|
1654
|
-
$.fn.slickNext = function
|
1599
|
+
$.fn.slickNext = function() {
|
1655
1600
|
var _ = this;
|
1656
|
-
return _.each(function
|
1601
|
+
return _.each(function(index, element) {
|
1657
1602
|
|
1658
|
-
|
1603
|
+
element.slick.changeSlide({
|
1604
|
+
data: {
|
1605
|
+
message: 'next'
|
1606
|
+
}
|
1607
|
+
});
|
1659
1608
|
|
1660
1609
|
});
|
1661
1610
|
};
|
1662
1611
|
|
1663
|
-
$.fn.slickPause = function
|
1612
|
+
$.fn.slickPause = function() {
|
1664
1613
|
var _ = this;
|
1665
|
-
return _.each(function
|
1614
|
+
return _.each(function(index, element) {
|
1666
1615
|
|
1667
|
-
|
1668
|
-
|
1616
|
+
element.slick.autoPlayClear();
|
1617
|
+
element.slick.paused = true;
|
1669
1618
|
|
1670
1619
|
});
|
1671
1620
|
};
|
1672
1621
|
|
1673
|
-
$.fn.slickPlay = function
|
1622
|
+
$.fn.slickPlay = function() {
|
1674
1623
|
var _ = this;
|
1675
|
-
return _.each(function
|
1624
|
+
return _.each(function(index, element) {
|
1676
1625
|
|
1677
|
-
|
1678
|
-
|
1626
|
+
element.slick.paused = false;
|
1627
|
+
element.slick.autoPlay();
|
1679
1628
|
|
1680
1629
|
});
|
1681
1630
|
};
|
1682
1631
|
|
1683
|
-
$.fn.slickPrev = function
|
1632
|
+
$.fn.slickPrev = function() {
|
1684
1633
|
var _ = this;
|
1685
|
-
return _.each(function
|
1634
|
+
return _.each(function(index, element) {
|
1686
1635
|
|
1687
|
-
|
1636
|
+
element.slick.changeSlide({
|
1637
|
+
data: {
|
1638
|
+
message: 'previous'
|
1639
|
+
}
|
1640
|
+
});
|
1688
1641
|
|
1689
1642
|
});
|
1690
1643
|
};
|
1691
1644
|
|
1692
|
-
$.fn.slickRemove = function
|
1645
|
+
$.fn.slickRemove = function(slideIndex, removeBefore) {
|
1693
1646
|
var _ = this;
|
1694
|
-
return _.each(function
|
1647
|
+
return _.each(function(index, element) {
|
1695
1648
|
|
1696
|
-
|
1649
|
+
element.slick.removeSlide(slideIndex, removeBefore);
|
1697
1650
|
|
1698
1651
|
});
|
1699
1652
|
};
|
1700
1653
|
|
1701
|
-
$.fn.slickSetOption = function
|
1654
|
+
$.fn.slickSetOption = function(option, value, refresh) {
|
1702
1655
|
var _ = this;
|
1703
|
-
return _.each(function
|
1656
|
+
return _.each(function(index, element) {
|
1704
1657
|
|
1705
|
-
|
1658
|
+
element.slick.options[option] = value;
|
1706
1659
|
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1660
|
+
if (refresh === true) {
|
1661
|
+
element.slick.unload();
|
1662
|
+
element.slick.reinit();
|
1663
|
+
}
|
1711
1664
|
|
1712
1665
|
});
|
1713
1666
|
};
|
1714
1667
|
|
1715
|
-
$.fn.slickUnfilter = function
|
1668
|
+
$.fn.slickUnfilter = function() {
|
1716
1669
|
var _ = this;
|
1717
|
-
return _.each(function
|
1670
|
+
return _.each(function(index, element) {
|
1718
1671
|
|
1719
|
-
|
1672
|
+
element.slick.unfilterSlides();
|
1720
1673
|
|
1721
1674
|
});
|
1722
1675
|
};
|
1723
1676
|
|
1724
|
-
$.fn.unslick = function
|
1677
|
+
$.fn.unslick = function() {
|
1725
1678
|
var _ = this;
|
1726
|
-
return _.each(function
|
1679
|
+
return _.each(function(index, element) {
|
1727
1680
|
|
1728
1681
|
element.slick.destroy();
|
1729
1682
|
|