jquery-slick-rails 1.5.9.1 → 1.6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/jquery.slick.js +457 -237
- data/lib/jquery-slick-rails/version.rb +1 -1
- data/test/dummy/log/test.log +21 -0
- data/test/dummy/tmp/cache/assets/CAA/480/sprockets%2F4d604d11576427ca96bd5781a30d2b67 +0 -0
- data/test/dummy/tmp/cache/assets/D3A/870/sprockets%2F52e808d22df40c648aa32dd4d77a58b2 +0 -0
- data/test/dummy/tmp/cache/assets/D70/480/sprockets%2Fae2a424972fb7e325d475870edb0def4 +0 -0
- data/test/integration/navigation_test.rb +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cd361a8085db54d090b8ac04245879f68ebdda1
|
4
|
+
data.tar.gz: c37e070e85bcefc251cb957d8156d50a8a193e1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4478e33eaac3f1273fa98843bd1b19d5631988ba27ac0c312a8038b3d40523e7d4396139f61b9dece3c714b565e0dce705263fb84df288c02f5ed280db507a6
|
7
|
+
data.tar.gz: 88a82c8177a36a829e037222de66b69647c84eafa203081d8318001f3ab18c243d039a7c9cccbea93c40090456cb85e26ac0325464e16e22f86c1ad8d77c17f3
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|___/_|_|\___|_|\_(_)/ |___/
|
7
7
|
|__/
|
8
8
|
|
9
|
-
Version: 1.
|
9
|
+
Version: 1.6.0
|
10
10
|
Author: Ken Wheeler
|
11
11
|
Website: http://kenwheeler.github.io
|
12
12
|
Docs: http://kenwheeler.github.io/slick
|
@@ -52,7 +52,7 @@
|
|
52
52
|
centerPadding: '50px',
|
53
53
|
cssEase: 'ease',
|
54
54
|
customPaging: function(slider, i) {
|
55
|
-
return '<button type="button" data-role="none" role="button"
|
55
|
+
return $('<button type="button" data-role="none" role="button" tabindex="0" />').text(i + 1);
|
56
56
|
},
|
57
57
|
dots: false,
|
58
58
|
dotsClass: 'slick-dots',
|
@@ -66,6 +66,7 @@
|
|
66
66
|
lazyLoad: 'ondemand',
|
67
67
|
mobileFirst: false,
|
68
68
|
pauseOnHover: true,
|
69
|
+
pauseOnFocus: true,
|
69
70
|
pauseOnDotsHover: false,
|
70
71
|
respondTo: 'window',
|
71
72
|
responsive: null,
|
@@ -81,7 +82,7 @@
|
|
81
82
|
touchMove: true,
|
82
83
|
touchThreshold: 5,
|
83
84
|
useCSS: true,
|
84
|
-
useTransform:
|
85
|
+
useTransform: true,
|
85
86
|
variableWidth: false,
|
86
87
|
vertical: false,
|
87
88
|
verticalSwiping: false,
|
@@ -124,8 +125,10 @@
|
|
124
125
|
_.breakpoints = [];
|
125
126
|
_.breakpointSettings = [];
|
126
127
|
_.cssTransitions = false;
|
128
|
+
_.focussed = false;
|
129
|
+
_.interrupted = false;
|
127
130
|
_.hidden = 'hidden';
|
128
|
-
_.paused =
|
131
|
+
_.paused = true;
|
129
132
|
_.positionProp = null;
|
130
133
|
_.respondTo = null;
|
131
134
|
_.rowCount = 1;
|
@@ -140,7 +143,7 @@
|
|
140
143
|
|
141
144
|
dataSettings = $(element).data('slick') || {};
|
142
145
|
|
143
|
-
_.options = $.extend({}, _.defaults,
|
146
|
+
_.options = $.extend({}, _.defaults, settings, dataSettings);
|
144
147
|
|
145
148
|
_.currentSlide = _.options.initialSlide;
|
146
149
|
|
@@ -156,6 +159,7 @@
|
|
156
159
|
|
157
160
|
_.autoPlay = $.proxy(_.autoPlay, _);
|
158
161
|
_.autoPlayClear = $.proxy(_.autoPlayClear, _);
|
162
|
+
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
|
159
163
|
_.changeSlide = $.proxy(_.changeSlide, _);
|
160
164
|
_.clickHandler = $.proxy(_.clickHandler, _);
|
161
165
|
_.selectHandler = $.proxy(_.selectHandler, _);
|
@@ -163,7 +167,6 @@
|
|
163
167
|
_.swipeHandler = $.proxy(_.swipeHandler, _);
|
164
168
|
_.dragHandler = $.proxy(_.dragHandler, _);
|
165
169
|
_.keyHandler = $.proxy(_.keyHandler, _);
|
166
|
-
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
|
167
170
|
|
168
171
|
_.instanceUid = instanceUid++;
|
169
172
|
|
@@ -175,7 +178,6 @@
|
|
175
178
|
|
176
179
|
_.registerBreakpoints();
|
177
180
|
_.init(true);
|
178
|
-
_.checkResponsive(true);
|
179
181
|
|
180
182
|
}
|
181
183
|
|
@@ -183,6 +185,17 @@
|
|
183
185
|
|
184
186
|
}());
|
185
187
|
|
188
|
+
Slick.prototype.activateADA = function() {
|
189
|
+
var _ = this;
|
190
|
+
|
191
|
+
_.$slideTrack.find('.slick-active').attr({
|
192
|
+
'aria-hidden': 'false'
|
193
|
+
}).find('a, input, button, select').attr({
|
194
|
+
'tabindex': '0'
|
195
|
+
});
|
196
|
+
|
197
|
+
};
|
198
|
+
|
186
199
|
Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
|
187
200
|
|
188
201
|
var _ = this;
|
@@ -318,7 +331,7 @@
|
|
318
331
|
|
319
332
|
};
|
320
333
|
|
321
|
-
Slick.prototype.
|
334
|
+
Slick.prototype.getNavTarget = function() {
|
322
335
|
|
323
336
|
var _ = this,
|
324
337
|
asNavFor = _.options.asNavFor;
|
@@ -327,6 +340,15 @@
|
|
327
340
|
asNavFor = $(asNavFor).not(_.$slider);
|
328
341
|
}
|
329
342
|
|
343
|
+
return asNavFor;
|
344
|
+
|
345
|
+
};
|
346
|
+
|
347
|
+
Slick.prototype.asNavFor = function(index) {
|
348
|
+
|
349
|
+
var _ = this,
|
350
|
+
asNavFor = _.getNavTarget();
|
351
|
+
|
330
352
|
if ( asNavFor !== null && typeof asNavFor === 'object' ) {
|
331
353
|
asNavFor.each(function() {
|
332
354
|
var target = $(this).slick('getSlick');
|
@@ -361,13 +383,10 @@
|
|
361
383
|
|
362
384
|
var _ = this;
|
363
385
|
|
364
|
-
|
365
|
-
clearInterval(_.autoPlayTimer);
|
366
|
-
}
|
386
|
+
_.autoPlayClear();
|
367
387
|
|
368
|
-
if (_.slideCount > _.options.slidesToShow
|
369
|
-
_.autoPlayTimer = setInterval(_.autoPlayIterator,
|
370
|
-
_.options.autoplaySpeed);
|
388
|
+
if ( _.slideCount > _.options.slidesToShow ) {
|
389
|
+
_.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
|
371
390
|
}
|
372
391
|
|
373
392
|
};
|
@@ -375,6 +394,7 @@
|
|
375
394
|
Slick.prototype.autoPlayClear = function() {
|
376
395
|
|
377
396
|
var _ = this;
|
397
|
+
|
378
398
|
if (_.autoPlayTimer) {
|
379
399
|
clearInterval(_.autoPlayTimer);
|
380
400
|
}
|
@@ -383,34 +403,30 @@
|
|
383
403
|
|
384
404
|
Slick.prototype.autoPlayIterator = function() {
|
385
405
|
|
386
|
-
var _ = this
|
406
|
+
var _ = this,
|
407
|
+
slideTo = _.currentSlide + _.options.slidesToScroll;
|
387
408
|
|
388
|
-
if (_.
|
409
|
+
if ( !_.paused && !_.interrupted && !_.focussed ) {
|
389
410
|
|
390
|
-
if (_.
|
411
|
+
if ( _.options.infinite === false ) {
|
391
412
|
|
392
|
-
if ((_.currentSlide + 1) === _.slideCount -
|
393
|
-
1) {
|
413
|
+
if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
|
394
414
|
_.direction = 0;
|
395
415
|
}
|
396
416
|
|
397
|
-
|
417
|
+
else if ( _.direction === 0 ) {
|
398
418
|
|
399
|
-
|
419
|
+
slideTo = _.currentSlide - _.options.slidesToScroll;
|
400
420
|
|
401
|
-
|
402
|
-
|
403
|
-
|
421
|
+
if ( _.currentSlide - 1 === 0 ) {
|
422
|
+
_.direction = 1;
|
423
|
+
}
|
404
424
|
|
405
425
|
}
|
406
426
|
|
407
|
-
_.slideHandler(_.currentSlide - _.options.slidesToScroll);
|
408
|
-
|
409
427
|
}
|
410
428
|
|
411
|
-
|
412
|
-
|
413
|
-
_.slideHandler(_.currentSlide + _.options.slidesToScroll);
|
429
|
+
_.slideHandler( slideTo );
|
414
430
|
|
415
431
|
}
|
416
432
|
|
@@ -463,20 +479,19 @@
|
|
463
479
|
Slick.prototype.buildDots = function() {
|
464
480
|
|
465
481
|
var _ = this,
|
466
|
-
i,
|
482
|
+
i, dot;
|
467
483
|
|
468
484
|
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
469
485
|
|
470
|
-
|
486
|
+
_.$slider.addClass('slick-dotted');
|
487
|
+
|
488
|
+
dot = $('<ul />').addClass(_.options.dotsClass);
|
471
489
|
|
472
490
|
for (i = 0; i <= _.getDotCount(); i += 1) {
|
473
|
-
|
491
|
+
dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
|
474
492
|
}
|
475
493
|
|
476
|
-
|
477
|
-
|
478
|
-
_.$dots = $(dotString).appendTo(
|
479
|
-
_.options.appendDots);
|
494
|
+
_.$dots = dot.appendTo(_.options.appendDots);
|
480
495
|
|
481
496
|
_.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');
|
482
497
|
|
@@ -563,7 +578,7 @@
|
|
563
578
|
newSlides.appendChild(slide);
|
564
579
|
}
|
565
580
|
|
566
|
-
_.$slider.
|
581
|
+
_.$slider.empty().append(newSlides);
|
567
582
|
_.$slider.children().children().children()
|
568
583
|
.css({
|
569
584
|
'width':(100 / _.options.slidesPerRow) + '%',
|
@@ -665,7 +680,7 @@
|
|
665
680
|
Slick.prototype.changeSlide = function(event, dontAnimate) {
|
666
681
|
|
667
682
|
var _ = this,
|
668
|
-
$target = $(event.
|
683
|
+
$target = $(event.currentTarget),
|
669
684
|
indexOffset, slideOffset, unevenOffset;
|
670
685
|
|
671
686
|
// If target is a link, prevent default action.
|
@@ -739,18 +754,15 @@
|
|
739
754
|
|
740
755
|
if (_.options.dots && _.$dots !== null) {
|
741
756
|
|
742
|
-
$('li', _.$dots)
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
$('li', _.$dots)
|
747
|
-
.off('mouseenter.slick', $.proxy(_.setPaused, _, true))
|
748
|
-
.off('mouseleave.slick', $.proxy(_.setPaused, _, false));
|
749
|
-
|
750
|
-
}
|
757
|
+
$('li', _.$dots)
|
758
|
+
.off('click.slick', _.changeSlide)
|
759
|
+
.off('mouseenter.slick', $.proxy(_.interrupt, _, true))
|
760
|
+
.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
751
761
|
|
752
762
|
}
|
753
763
|
|
764
|
+
_.$slider.off('focus.slick blur.slick');
|
765
|
+
|
754
766
|
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
755
767
|
_.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
|
756
768
|
_.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
|
@@ -765,8 +777,7 @@
|
|
765
777
|
|
766
778
|
$(document).off(_.visibilityChange, _.visibility);
|
767
779
|
|
768
|
-
_
|
769
|
-
_.$list.off('mouseleave.slick', $.proxy(_.setPaused, _, false));
|
780
|
+
_.cleanUpSlideEvents();
|
770
781
|
|
771
782
|
if (_.options.accessibility === true) {
|
772
783
|
_.$list.off('keydown.slick', _.keyHandler);
|
@@ -784,6 +795,16 @@
|
|
784
795
|
|
785
796
|
$(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
|
786
797
|
$(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
|
798
|
+
|
799
|
+
};
|
800
|
+
|
801
|
+
Slick.prototype.cleanUpSlideEvents = function() {
|
802
|
+
|
803
|
+
var _ = this;
|
804
|
+
|
805
|
+
_.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
|
806
|
+
_.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
807
|
+
|
787
808
|
};
|
788
809
|
|
789
810
|
Slick.prototype.cleanUpRows = function() {
|
@@ -793,7 +814,7 @@
|
|
793
814
|
if(_.options.rows > 1) {
|
794
815
|
originalSlides = _.$slides.children().children();
|
795
816
|
originalSlides.removeAttr('style');
|
796
|
-
_.$slider.
|
817
|
+
_.$slider.empty().append(originalSlides);
|
797
818
|
}
|
798
819
|
|
799
820
|
};
|
@@ -832,7 +853,7 @@
|
|
832
853
|
_.$prevArrow
|
833
854
|
.removeClass('slick-disabled slick-arrow slick-hidden')
|
834
855
|
.removeAttr('aria-hidden aria-disabled tabindex')
|
835
|
-
.css(
|
856
|
+
.css('display','');
|
836
857
|
|
837
858
|
if ( _.htmlExpr.test( _.options.prevArrow )) {
|
838
859
|
_.$prevArrow.remove();
|
@@ -844,7 +865,7 @@
|
|
844
865
|
_.$nextArrow
|
845
866
|
.removeClass('slick-disabled slick-arrow slick-hidden')
|
846
867
|
.removeAttr('aria-hidden aria-disabled tabindex')
|
847
|
-
.css(
|
868
|
+
.css('display','');
|
848
869
|
|
849
870
|
if ( _.htmlExpr.test( _.options.nextArrow )) {
|
850
871
|
_.$nextArrow.remove();
|
@@ -876,6 +897,7 @@
|
|
876
897
|
|
877
898
|
_.$slider.removeClass('slick-slider');
|
878
899
|
_.$slider.removeClass('slick-initialized');
|
900
|
+
_.$slider.removeClass('slick-dotted');
|
879
901
|
|
880
902
|
_.unslicked = true;
|
881
903
|
|
@@ -980,6 +1002,30 @@
|
|
980
1002
|
|
981
1003
|
};
|
982
1004
|
|
1005
|
+
Slick.prototype.focusHandler = function() {
|
1006
|
+
|
1007
|
+
var _ = this;
|
1008
|
+
|
1009
|
+
_.$slider
|
1010
|
+
.off('focus.slick blur.slick')
|
1011
|
+
.on('focus.slick blur.slick',
|
1012
|
+
'*:not(.slick-arrow)', function(event) {
|
1013
|
+
|
1014
|
+
event.stopImmediatePropagation();
|
1015
|
+
var $sf = $(this);
|
1016
|
+
|
1017
|
+
setTimeout(function() {
|
1018
|
+
|
1019
|
+
if( _.options.pauseOnFocus ) {
|
1020
|
+
_.focussed = $sf.is(':focus');
|
1021
|
+
_.autoPlay();
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
}, 0);
|
1025
|
+
|
1026
|
+
});
|
1027
|
+
};
|
1028
|
+
|
983
1029
|
Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
|
984
1030
|
|
985
1031
|
var _ = this;
|
@@ -1204,6 +1250,8 @@
|
|
1204
1250
|
_.initializeEvents();
|
1205
1251
|
_.updateArrows();
|
1206
1252
|
_.updateDots();
|
1253
|
+
_.checkResponsive(true);
|
1254
|
+
_.focusHandler();
|
1207
1255
|
|
1208
1256
|
}
|
1209
1257
|
|
@@ -1215,6 +1263,48 @@
|
|
1215
1263
|
_.initADA();
|
1216
1264
|
}
|
1217
1265
|
|
1266
|
+
if ( _.options.autoplay ) {
|
1267
|
+
|
1268
|
+
_.paused = false;
|
1269
|
+
_.autoPlay();
|
1270
|
+
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
};
|
1274
|
+
|
1275
|
+
Slick.prototype.initADA = function() {
|
1276
|
+
var _ = this;
|
1277
|
+
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
|
1278
|
+
'aria-hidden': 'true',
|
1279
|
+
'tabindex': '-1'
|
1280
|
+
}).find('a, input, button, select').attr({
|
1281
|
+
'tabindex': '-1'
|
1282
|
+
});
|
1283
|
+
|
1284
|
+
_.$slideTrack.attr('role', 'listbox');
|
1285
|
+
|
1286
|
+
_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
|
1287
|
+
$(this).attr({
|
1288
|
+
'role': 'option',
|
1289
|
+
'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
|
1290
|
+
});
|
1291
|
+
});
|
1292
|
+
|
1293
|
+
if (_.$dots !== null) {
|
1294
|
+
_.$dots.attr('role', 'tablist').find('li').each(function(i) {
|
1295
|
+
$(this).attr({
|
1296
|
+
'role': 'presentation',
|
1297
|
+
'aria-selected': 'false',
|
1298
|
+
'aria-controls': 'navigation' + _.instanceUid + i + '',
|
1299
|
+
'id': 'slick-slide' + _.instanceUid + i + ''
|
1300
|
+
});
|
1301
|
+
})
|
1302
|
+
.first().attr('aria-selected', 'true').end()
|
1303
|
+
.find('button').attr('role', 'button').end()
|
1304
|
+
.closest('div').attr('role', 'toolbar');
|
1305
|
+
}
|
1306
|
+
_.activateADA();
|
1307
|
+
|
1218
1308
|
};
|
1219
1309
|
|
1220
1310
|
Slick.prototype.initArrowEvents = function() {
|
@@ -1222,12 +1312,16 @@
|
|
1222
1312
|
var _ = this;
|
1223
1313
|
|
1224
1314
|
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
1225
|
-
_.$prevArrow
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1315
|
+
_.$prevArrow
|
1316
|
+
.off('click.slick')
|
1317
|
+
.on('click.slick', {
|
1318
|
+
message: 'previous'
|
1319
|
+
}, _.changeSlide);
|
1320
|
+
_.$nextArrow
|
1321
|
+
.off('click.slick')
|
1322
|
+
.on('click.slick', {
|
1323
|
+
message: 'next'
|
1324
|
+
}, _.changeSlide);
|
1231
1325
|
}
|
1232
1326
|
|
1233
1327
|
};
|
@@ -1242,10 +1336,25 @@
|
|
1242
1336
|
}, _.changeSlide);
|
1243
1337
|
}
|
1244
1338
|
|
1245
|
-
if (_.options.dots === true && _.options.pauseOnDotsHover === true
|
1339
|
+
if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {
|
1340
|
+
|
1246
1341
|
$('li', _.$dots)
|
1247
|
-
.on('mouseenter.slick', $.proxy(_.
|
1248
|
-
.on('mouseleave.slick', $.proxy(_.
|
1342
|
+
.on('mouseenter.slick', $.proxy(_.interrupt, _, true))
|
1343
|
+
.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
1344
|
+
|
1345
|
+
}
|
1346
|
+
|
1347
|
+
};
|
1348
|
+
|
1349
|
+
Slick.prototype.initSlideEvents = function() {
|
1350
|
+
|
1351
|
+
var _ = this;
|
1352
|
+
|
1353
|
+
if ( _.options.pauseOnHover ) {
|
1354
|
+
|
1355
|
+
_.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
|
1356
|
+
_.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
1357
|
+
|
1249
1358
|
}
|
1250
1359
|
|
1251
1360
|
};
|
@@ -1257,6 +1366,7 @@
|
|
1257
1366
|
_.initArrowEvents();
|
1258
1367
|
|
1259
1368
|
_.initDotEvents();
|
1369
|
+
_.initSlideEvents();
|
1260
1370
|
|
1261
1371
|
_.$list.on('touchstart.slick mousedown.slick', {
|
1262
1372
|
action: 'start'
|
@@ -1275,9 +1385,6 @@
|
|
1275
1385
|
|
1276
1386
|
$(document).on(_.visibilityChange, $.proxy(_.visibility, _));
|
1277
1387
|
|
1278
|
-
_.$list.on('mouseenter.slick', $.proxy(_.setPaused, _, true));
|
1279
|
-
_.$list.on('mouseleave.slick', $.proxy(_.setPaused, _, false));
|
1280
|
-
|
1281
1388
|
if (_.options.accessibility === true) {
|
1282
1389
|
_.$list.on('keydown.slick', _.keyHandler);
|
1283
1390
|
}
|
@@ -1314,12 +1421,6 @@
|
|
1314
1421
|
|
1315
1422
|
}
|
1316
1423
|
|
1317
|
-
if (_.options.autoplay === true) {
|
1318
|
-
|
1319
|
-
_.autoPlay();
|
1320
|
-
|
1321
|
-
}
|
1322
|
-
|
1323
1424
|
};
|
1324
1425
|
|
1325
1426
|
Slick.prototype.keyHandler = function(event) {
|
@@ -1330,13 +1431,13 @@
|
|
1330
1431
|
if (event.keyCode === 37 && _.options.accessibility === true) {
|
1331
1432
|
_.changeSlide({
|
1332
1433
|
data: {
|
1333
|
-
message: 'previous'
|
1434
|
+
message: _.options.rtl === true ? 'next' : 'previous'
|
1334
1435
|
}
|
1335
1436
|
});
|
1336
1437
|
} else if (event.keyCode === 39 && _.options.accessibility === true) {
|
1337
1438
|
_.changeSlide({
|
1338
1439
|
data: {
|
1339
|
-
message: 'next'
|
1440
|
+
message: _.options.rtl === true ? 'previous' : 'next'
|
1340
1441
|
}
|
1341
1442
|
});
|
1342
1443
|
}
|
@@ -1350,6 +1451,7 @@
|
|
1350
1451
|
loadRange, cloneRange, rangeStart, rangeEnd;
|
1351
1452
|
|
1352
1453
|
function loadImages(imagesScope) {
|
1454
|
+
|
1353
1455
|
$('img[data-lazy]', imagesScope).each(function() {
|
1354
1456
|
|
1355
1457
|
var image = $(this),
|
@@ -1357,6 +1459,7 @@
|
|
1357
1459
|
imageToLoad = document.createElement('img');
|
1358
1460
|
|
1359
1461
|
imageToLoad.onload = function() {
|
1462
|
+
|
1360
1463
|
image
|
1361
1464
|
.animate({ opacity: 0 }, 100, function() {
|
1362
1465
|
image
|
@@ -1366,12 +1469,26 @@
|
|
1366
1469
|
.removeAttr('data-lazy')
|
1367
1470
|
.removeClass('slick-loading');
|
1368
1471
|
});
|
1472
|
+
_.$slider.trigger('lazyLoaded', [_, image, imageSource]);
|
1369
1473
|
});
|
1474
|
+
|
1475
|
+
};
|
1476
|
+
|
1477
|
+
imageToLoad.onerror = function() {
|
1478
|
+
|
1479
|
+
image
|
1480
|
+
.removeAttr( 'data-lazy' )
|
1481
|
+
.removeClass( 'slick-loading' )
|
1482
|
+
.addClass( 'slick-lazyload-error' );
|
1483
|
+
|
1484
|
+
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
|
1485
|
+
|
1370
1486
|
};
|
1371
1487
|
|
1372
1488
|
imageToLoad.src = imageSource;
|
1373
1489
|
|
1374
1490
|
});
|
1491
|
+
|
1375
1492
|
}
|
1376
1493
|
|
1377
1494
|
if (_.options.centerMode === true) {
|
@@ -1384,7 +1501,7 @@
|
|
1384
1501
|
}
|
1385
1502
|
} else {
|
1386
1503
|
rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
|
1387
|
-
rangeEnd = rangeStart + _.options.slidesToShow;
|
1504
|
+
rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
|
1388
1505
|
if (_.options.fade === true) {
|
1389
1506
|
if (rangeStart > 0) rangeStart--;
|
1390
1507
|
if (rangeEnd <= _.slideCount) rangeEnd++;
|
@@ -1462,8 +1579,11 @@
|
|
1462
1579
|
|
1463
1580
|
var _ = this;
|
1464
1581
|
|
1465
|
-
_.paused = false;
|
1466
1582
|
_.autoPlay();
|
1583
|
+
_.options.autoplay = true;
|
1584
|
+
_.paused = false;
|
1585
|
+
_.focussed = false;
|
1586
|
+
_.interrupted = false;
|
1467
1587
|
|
1468
1588
|
};
|
1469
1589
|
|
@@ -1471,19 +1591,24 @@
|
|
1471
1591
|
|
1472
1592
|
var _ = this;
|
1473
1593
|
|
1474
|
-
|
1594
|
+
if( !_.unslicked ) {
|
1475
1595
|
|
1476
|
-
|
1596
|
+
_.$slider.trigger('afterChange', [_, index]);
|
1477
1597
|
|
1478
|
-
|
1598
|
+
_.animating = false;
|
1479
1599
|
|
1480
|
-
|
1600
|
+
_.setPosition();
|
1601
|
+
|
1602
|
+
_.swipeLeft = null;
|
1603
|
+
|
1604
|
+
if ( _.options.autoplay ) {
|
1605
|
+
_.autoPlay();
|
1606
|
+
}
|
1607
|
+
|
1608
|
+
if (_.options.accessibility === true) {
|
1609
|
+
_.initADA();
|
1610
|
+
}
|
1481
1611
|
|
1482
|
-
if (_.options.autoplay === true && _.paused === false) {
|
1483
|
-
_.autoPlay();
|
1484
|
-
}
|
1485
|
-
if (_.options.accessibility === true) {
|
1486
|
-
_.initADA();
|
1487
1612
|
}
|
1488
1613
|
|
1489
1614
|
};
|
@@ -1501,50 +1626,97 @@
|
|
1501
1626
|
};
|
1502
1627
|
|
1503
1628
|
Slick.prototype.preventDefault = function(event) {
|
1629
|
+
|
1504
1630
|
event.preventDefault();
|
1631
|
+
|
1505
1632
|
};
|
1506
1633
|
|
1507
|
-
Slick.prototype.progressiveLazyLoad = function() {
|
1634
|
+
Slick.prototype.progressiveLazyLoad = function( tryCount ) {
|
1635
|
+
|
1636
|
+
tryCount = tryCount || 1;
|
1508
1637
|
|
1509
1638
|
var _ = this,
|
1510
|
-
|
1639
|
+
$imgsToLoad = $( 'img[data-lazy]', _.$slider ),
|
1640
|
+
image,
|
1641
|
+
imageSource,
|
1642
|
+
imageToLoad;
|
1511
1643
|
|
1512
|
-
|
1644
|
+
if ( $imgsToLoad.length ) {
|
1513
1645
|
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1646
|
+
image = $imgsToLoad.first();
|
1647
|
+
imageSource = image.attr('data-lazy');
|
1648
|
+
imageToLoad = document.createElement('img');
|
1649
|
+
|
1650
|
+
imageToLoad.onload = function() {
|
1651
|
+
|
1652
|
+
image
|
1653
|
+
.attr( 'src', imageSource )
|
1654
|
+
.removeAttr('data-lazy')
|
1655
|
+
.removeClass('slick-loading');
|
1656
|
+
|
1657
|
+
if ( _.options.adaptiveHeight === true ) {
|
1658
|
+
_.setPosition();
|
1659
|
+
}
|
1660
|
+
|
1661
|
+
_.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
|
1662
|
+
_.progressiveLazyLoad();
|
1663
|
+
|
1664
|
+
};
|
1665
|
+
|
1666
|
+
imageToLoad.onerror = function() {
|
1667
|
+
|
1668
|
+
if ( tryCount < 3 ) {
|
1669
|
+
|
1670
|
+
/**
|
1671
|
+
* try to load the image 3 times,
|
1672
|
+
* leave a slight delay so we don't get
|
1673
|
+
* servers blocking the request.
|
1674
|
+
*/
|
1675
|
+
setTimeout( function() {
|
1676
|
+
_.progressiveLazyLoad( tryCount + 1 );
|
1677
|
+
}, 500 );
|
1678
|
+
|
1679
|
+
} else {
|
1680
|
+
|
1681
|
+
image
|
1682
|
+
.removeAttr( 'data-lazy' )
|
1683
|
+
.removeClass( 'slick-loading' )
|
1684
|
+
.addClass( 'slick-lazyload-error' );
|
1685
|
+
|
1686
|
+
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
|
1687
|
+
|
1688
|
+
_.progressiveLazyLoad();
|
1689
|
+
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
};
|
1693
|
+
|
1694
|
+
imageToLoad.src = imageSource;
|
1695
|
+
|
1696
|
+
} else {
|
1697
|
+
|
1698
|
+
_.$slider.trigger('allImagesLoaded', [ _ ]);
|
1520
1699
|
|
1521
|
-
if (_.options.adaptiveHeight === true) {
|
1522
|
-
_.setPosition();
|
1523
|
-
}
|
1524
|
-
})
|
1525
|
-
.error(function() {
|
1526
|
-
targetImage.removeAttr('data-lazy');
|
1527
|
-
_.progressiveLazyLoad();
|
1528
|
-
});
|
1529
1700
|
}
|
1530
1701
|
|
1531
1702
|
};
|
1532
1703
|
|
1533
1704
|
Slick.prototype.refresh = function( initializing ) {
|
1534
1705
|
|
1535
|
-
var _ = this, currentSlide,
|
1706
|
+
var _ = this, currentSlide, lastVisibleIndex;
|
1536
1707
|
|
1537
|
-
|
1708
|
+
lastVisibleIndex = _.slideCount - _.options.slidesToShow;
|
1709
|
+
|
1710
|
+
// in non-infinite sliders, we don't want to go past the
|
1711
|
+
// last visible index.
|
1712
|
+
if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
|
1713
|
+
_.currentSlide = lastVisibleIndex;
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
// if less slides than to show, go to start.
|
1717
|
+
if ( _.slideCount <= _.options.slidesToShow ) {
|
1718
|
+
_.currentSlide = 0;
|
1538
1719
|
|
1539
|
-
// check that the new breakpoint can actually accept the
|
1540
|
-
// "current slide" as the current slide, otherwise we need
|
1541
|
-
// to set it to the closest possible value.
|
1542
|
-
if ( !_.options.infinite ) {
|
1543
|
-
if ( _.slideCount <= _.options.slidesToShow ) {
|
1544
|
-
_.currentSlide = 0;
|
1545
|
-
} else if ( _.currentSlide > firstVisible ) {
|
1546
|
-
_.currentSlide = firstVisible;
|
1547
|
-
}
|
1548
1720
|
}
|
1549
1721
|
|
1550
1722
|
currentSlide = _.currentSlide;
|
@@ -1573,7 +1745,7 @@
|
|
1573
1745
|
var _ = this, breakpoint, currentBreakpoint, l,
|
1574
1746
|
responsiveSettings = _.options.responsive || null;
|
1575
1747
|
|
1576
|
-
if ( $.type(responsiveSettings) ===
|
1748
|
+
if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
|
1577
1749
|
|
1578
1750
|
_.respondTo = _.options.respondTo || 'window';
|
1579
1751
|
|
@@ -1637,6 +1809,8 @@
|
|
1637
1809
|
_.buildDots();
|
1638
1810
|
_.updateDots();
|
1639
1811
|
_.initDotEvents();
|
1812
|
+
_.cleanUpSlideEvents();
|
1813
|
+
_.initSlideEvents();
|
1640
1814
|
|
1641
1815
|
_.checkResponsive(false, true);
|
1642
1816
|
|
@@ -1644,15 +1818,15 @@
|
|
1644
1818
|
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
|
1645
1819
|
}
|
1646
1820
|
|
1647
|
-
_.setSlideClasses(0);
|
1821
|
+
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
|
1648
1822
|
|
1649
1823
|
_.setPosition();
|
1824
|
+
_.focusHandler();
|
1650
1825
|
|
1651
|
-
_
|
1826
|
+
_.paused = !_.options.autoplay;
|
1827
|
+
_.autoPlay();
|
1652
1828
|
|
1653
|
-
|
1654
|
-
_.focusHandler();
|
1655
|
-
}
|
1829
|
+
_.$slider.trigger('reInit', [_]);
|
1656
1830
|
|
1657
1831
|
};
|
1658
1832
|
|
@@ -1817,36 +1991,103 @@
|
|
1817
1991
|
|
1818
1992
|
};
|
1819
1993
|
|
1820
|
-
Slick.prototype.setOption =
|
1994
|
+
Slick.prototype.setOption =
|
1995
|
+
Slick.prototype.slickSetOption = function() {
|
1821
1996
|
|
1822
|
-
|
1997
|
+
/**
|
1998
|
+
* accepts arguments in format of:
|
1999
|
+
*
|
2000
|
+
* - for changing a single option's value:
|
2001
|
+
* .slick("setOption", option, value, refresh )
|
2002
|
+
*
|
2003
|
+
* - for changing a set of responsive options:
|
2004
|
+
* .slick("setOption", 'responsive', [{}, ...], refresh )
|
2005
|
+
*
|
2006
|
+
* - for updating multiple values at once (not responsive)
|
2007
|
+
* .slick("setOption", { 'option': value, ... }, refresh )
|
2008
|
+
*/
|
2009
|
+
|
2010
|
+
var _ = this, l, item, option, value, refresh = false, type;
|
2011
|
+
|
2012
|
+
if( $.type( arguments[0] ) === 'object' ) {
|
2013
|
+
|
2014
|
+
option = arguments[0];
|
2015
|
+
refresh = arguments[1];
|
2016
|
+
type = 'multiple';
|
2017
|
+
|
2018
|
+
} else if ( $.type( arguments[0] ) === 'string' ) {
|
2019
|
+
|
2020
|
+
option = arguments[0];
|
2021
|
+
value = arguments[1];
|
2022
|
+
refresh = arguments[2];
|
2023
|
+
|
2024
|
+
if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
|
2025
|
+
|
2026
|
+
type = 'responsive';
|
2027
|
+
|
2028
|
+
} else if ( typeof arguments[1] !== 'undefined' ) {
|
2029
|
+
|
2030
|
+
type = 'single';
|
2031
|
+
|
2032
|
+
}
|
2033
|
+
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
if ( type === 'single' ) {
|
2037
|
+
|
2038
|
+
_.options[option] = value;
|
2039
|
+
|
2040
|
+
|
2041
|
+
} else if ( type === 'multiple' ) {
|
2042
|
+
|
2043
|
+
$.each( option , function( opt, val ) {
|
2044
|
+
|
2045
|
+
_.options[opt] = val;
|
2046
|
+
|
2047
|
+
});
|
2048
|
+
|
2049
|
+
|
2050
|
+
} else if ( type === 'responsive' ) {
|
2051
|
+
|
2052
|
+
for ( item in value ) {
|
2053
|
+
|
2054
|
+
if( $.type( _.options.responsive ) !== 'array' ) {
|
2055
|
+
|
2056
|
+
_.options.responsive = [ value[item] ];
|
2057
|
+
|
2058
|
+
} else {
|
2059
|
+
|
2060
|
+
l = _.options.responsive.length-1;
|
2061
|
+
|
2062
|
+
// loop through the responsive object and splice out duplicates.
|
2063
|
+
while( l >= 0 ) {
|
2064
|
+
|
2065
|
+
if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
|
2066
|
+
|
2067
|
+
_.options.responsive.splice(l,1);
|
2068
|
+
|
2069
|
+
}
|
2070
|
+
|
2071
|
+
l--;
|
2072
|
+
|
2073
|
+
}
|
2074
|
+
|
2075
|
+
_.options.responsive.push( value[item] );
|
1823
2076
|
|
1824
|
-
if( option === "responsive" && $.type(value) === "array" ) {
|
1825
|
-
for ( item in value ) {
|
1826
|
-
if( $.type( _.options.responsive ) !== "array" ) {
|
1827
|
-
_.options.responsive = [ value[item] ];
|
1828
|
-
} else {
|
1829
|
-
l = _.options.responsive.length-1;
|
1830
|
-
// loop through the responsive object and splice out duplicates.
|
1831
|
-
while( l >= 0 ) {
|
1832
|
-
if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
|
1833
|
-
_.options.responsive.splice(l,1);
|
1834
2077
|
}
|
1835
|
-
|
2078
|
+
|
1836
2079
|
}
|
1837
|
-
|
2080
|
+
|
1838
2081
|
}
|
1839
|
-
}
|
1840
|
-
} else {
|
1841
|
-
_.options[option] = value;
|
1842
|
-
}
|
1843
2082
|
|
1844
|
-
|
1845
|
-
_.unload();
|
1846
|
-
_.reinit();
|
1847
|
-
}
|
2083
|
+
if ( refresh ) {
|
1848
2084
|
|
1849
|
-
|
2085
|
+
_.unload();
|
2086
|
+
_.reinit();
|
2087
|
+
|
2088
|
+
}
|
2089
|
+
|
2090
|
+
};
|
1850
2091
|
|
1851
2092
|
Slick.prototype.setPosition = function() {
|
1852
2093
|
|
@@ -2077,18 +2318,15 @@
|
|
2077
2318
|
|
2078
2319
|
};
|
2079
2320
|
|
2080
|
-
Slick.prototype.
|
2321
|
+
Slick.prototype.interrupt = function( toggle ) {
|
2081
2322
|
|
2082
2323
|
var _ = this;
|
2083
2324
|
|
2084
|
-
if
|
2085
|
-
_.
|
2086
|
-
if (!paused) {
|
2087
|
-
_.autoPlay();
|
2088
|
-
} else {
|
2089
|
-
_.autoPlayClear();
|
2090
|
-
}
|
2325
|
+
if( !toggle ) {
|
2326
|
+
_.autoPlay();
|
2091
2327
|
}
|
2328
|
+
_.interrupted = toggle;
|
2329
|
+
|
2092
2330
|
};
|
2093
2331
|
|
2094
2332
|
Slick.prototype.selectHandler = function(event) {
|
@@ -2119,7 +2357,7 @@
|
|
2119
2357
|
Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
|
2120
2358
|
|
2121
2359
|
var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
|
2122
|
-
_ = this;
|
2360
|
+
_ = this, navTarget;
|
2123
2361
|
|
2124
2362
|
sync = sync || false;
|
2125
2363
|
|
@@ -2171,7 +2409,7 @@
|
|
2171
2409
|
return;
|
2172
2410
|
}
|
2173
2411
|
|
2174
|
-
if (_.options.autoplay
|
2412
|
+
if ( _.options.autoplay ) {
|
2175
2413
|
clearInterval(_.autoPlayTimer);
|
2176
2414
|
}
|
2177
2415
|
|
@@ -2200,6 +2438,17 @@
|
|
2200
2438
|
|
2201
2439
|
_.setSlideClasses(_.currentSlide);
|
2202
2440
|
|
2441
|
+
if ( _.options.asNavFor ) {
|
2442
|
+
|
2443
|
+
navTarget = _.getNavTarget();
|
2444
|
+
navTarget = navTarget.slick('getSlick');
|
2445
|
+
|
2446
|
+
if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
|
2447
|
+
navTarget.setSlideClasses(_.currentSlide);
|
2448
|
+
}
|
2449
|
+
|
2450
|
+
}
|
2451
|
+
|
2203
2452
|
_.updateDots();
|
2204
2453
|
_.updateArrows();
|
2205
2454
|
|
@@ -2274,9 +2523,9 @@
|
|
2274
2523
|
}
|
2275
2524
|
if (_.options.verticalSwiping === true) {
|
2276
2525
|
if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
|
2277
|
-
return '
|
2526
|
+
return 'down';
|
2278
2527
|
} else {
|
2279
|
-
return '
|
2528
|
+
return 'up';
|
2280
2529
|
}
|
2281
2530
|
}
|
2282
2531
|
|
@@ -2287,44 +2536,73 @@
|
|
2287
2536
|
Slick.prototype.swipeEnd = function(event) {
|
2288
2537
|
|
2289
2538
|
var _ = this,
|
2290
|
-
slideCount
|
2539
|
+
slideCount,
|
2540
|
+
direction;
|
2291
2541
|
|
2292
2542
|
_.dragging = false;
|
2543
|
+
_.interrupted = false;
|
2544
|
+
_.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
|
2293
2545
|
|
2294
|
-
|
2295
|
-
|
2296
|
-
if (_.touchObject.curX === undefined) {
|
2546
|
+
if ( _.touchObject.curX === undefined ) {
|
2297
2547
|
return false;
|
2298
2548
|
}
|
2299
2549
|
|
2300
|
-
if (_.touchObject.edgeHit === true) {
|
2301
|
-
_.$slider.trigger('edge', [_, _.swipeDirection()]);
|
2550
|
+
if ( _.touchObject.edgeHit === true ) {
|
2551
|
+
_.$slider.trigger('edge', [_, _.swipeDirection() ]);
|
2302
2552
|
}
|
2303
2553
|
|
2304
|
-
if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
|
2554
|
+
if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
|
2555
|
+
|
2556
|
+
direction = _.swipeDirection();
|
2557
|
+
|
2558
|
+
switch ( direction ) {
|
2305
2559
|
|
2306
|
-
switch (_.swipeDirection()) {
|
2307
2560
|
case 'left':
|
2308
|
-
|
2309
|
-
|
2561
|
+
case 'down':
|
2562
|
+
|
2563
|
+
slideCount =
|
2564
|
+
_.options.swipeToSlide ?
|
2565
|
+
_.checkNavigable( _.currentSlide + _.getSlideCount() ) :
|
2566
|
+
_.currentSlide + _.getSlideCount();
|
2567
|
+
|
2310
2568
|
_.currentDirection = 0;
|
2311
|
-
|
2312
|
-
_.$slider.trigger('swipe', [_, 'left']);
|
2569
|
+
|
2313
2570
|
break;
|
2314
2571
|
|
2315
2572
|
case 'right':
|
2316
|
-
|
2317
|
-
|
2573
|
+
case 'up':
|
2574
|
+
|
2575
|
+
slideCount =
|
2576
|
+
_.options.swipeToSlide ?
|
2577
|
+
_.checkNavigable( _.currentSlide - _.getSlideCount() ) :
|
2578
|
+
_.currentSlide - _.getSlideCount();
|
2579
|
+
|
2318
2580
|
_.currentDirection = 1;
|
2319
|
-
|
2320
|
-
_.$slider.trigger('swipe', [_, 'right']);
|
2581
|
+
|
2321
2582
|
break;
|
2583
|
+
|
2584
|
+
default:
|
2585
|
+
|
2586
|
+
|
2322
2587
|
}
|
2588
|
+
|
2589
|
+
if( direction != 'vertical' ) {
|
2590
|
+
|
2591
|
+
_.slideHandler( slideCount );
|
2592
|
+
_.touchObject = {};
|
2593
|
+
_.$slider.trigger('swipe', [_, direction ]);
|
2594
|
+
|
2595
|
+
}
|
2596
|
+
|
2323
2597
|
} else {
|
2324
|
-
|
2325
|
-
|
2598
|
+
|
2599
|
+
if ( _.touchObject.startX !== _.touchObject.curX ) {
|
2600
|
+
|
2601
|
+
_.slideHandler( _.currentSlide );
|
2326
2602
|
_.touchObject = {};
|
2603
|
+
|
2327
2604
|
}
|
2605
|
+
|
2328
2606
|
}
|
2329
2607
|
|
2330
2608
|
};
|
@@ -2447,6 +2725,8 @@
|
|
2447
2725
|
var _ = this,
|
2448
2726
|
touches;
|
2449
2727
|
|
2728
|
+
_.interrupted = true;
|
2729
|
+
|
2450
2730
|
if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
|
2451
2731
|
_.touchObject = {};
|
2452
2732
|
return false;
|
@@ -2574,80 +2854,20 @@
|
|
2574
2854
|
|
2575
2855
|
var _ = this;
|
2576
2856
|
|
2577
|
-
if (
|
2578
|
-
_.paused = true;
|
2579
|
-
_.autoPlayClear();
|
2580
|
-
} else {
|
2581
|
-
if (_.options.autoplay === true) {
|
2582
|
-
_.paused = false;
|
2583
|
-
_.autoPlay();
|
2584
|
-
}
|
2585
|
-
}
|
2586
|
-
|
2587
|
-
};
|
2588
|
-
Slick.prototype.initADA = function() {
|
2589
|
-
var _ = this;
|
2590
|
-
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
|
2591
|
-
'aria-hidden': 'true',
|
2592
|
-
'tabindex': '-1'
|
2593
|
-
}).find('a, input, button, select').attr({
|
2594
|
-
'tabindex': '-1'
|
2595
|
-
});
|
2596
|
-
|
2597
|
-
_.$slideTrack.attr('role', 'listbox');
|
2857
|
+
if ( _.options.autoplay ) {
|
2598
2858
|
|
2599
|
-
|
2600
|
-
$(this).attr({
|
2601
|
-
'role': 'option',
|
2602
|
-
'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
|
2603
|
-
});
|
2604
|
-
});
|
2859
|
+
if ( document[_.hidden] ) {
|
2605
2860
|
|
2606
|
-
|
2607
|
-
_.$dots.attr('role', 'tablist').find('li').each(function(i) {
|
2608
|
-
$(this).attr({
|
2609
|
-
'role': 'presentation',
|
2610
|
-
'aria-selected': 'false',
|
2611
|
-
'aria-controls': 'navigation' + _.instanceUid + i + '',
|
2612
|
-
'id': 'slick-slide' + _.instanceUid + i + ''
|
2613
|
-
});
|
2614
|
-
})
|
2615
|
-
.first().attr('aria-selected', 'true').end()
|
2616
|
-
.find('button').attr('role', 'button').end()
|
2617
|
-
.closest('div').attr('role', 'toolbar');
|
2618
|
-
}
|
2619
|
-
_.activateADA();
|
2861
|
+
_.interrupted = true;
|
2620
2862
|
|
2621
|
-
|
2863
|
+
} else {
|
2622
2864
|
|
2623
|
-
|
2624
|
-
var _ = this;
|
2865
|
+
_.interrupted = false;
|
2625
2866
|
|
2626
|
-
|
2627
|
-
'aria-hidden': 'false'
|
2628
|
-
}).find('a, input, button, select').attr({
|
2629
|
-
'tabindex': '0'
|
2630
|
-
});
|
2867
|
+
}
|
2631
2868
|
|
2632
|
-
|
2869
|
+
}
|
2633
2870
|
|
2634
|
-
Slick.prototype.focusHandler = function() {
|
2635
|
-
var _ = this;
|
2636
|
-
_.$slider.on('focus.slick blur.slick', '*', function(event) {
|
2637
|
-
event.stopImmediatePropagation();
|
2638
|
-
var sf = $(this);
|
2639
|
-
setTimeout(function() {
|
2640
|
-
if (_.isPlay) {
|
2641
|
-
if (sf.is(':focus')) {
|
2642
|
-
_.autoPlayClear();
|
2643
|
-
_.paused = true;
|
2644
|
-
} else {
|
2645
|
-
_.paused = false;
|
2646
|
-
_.autoPlay();
|
2647
|
-
}
|
2648
|
-
}
|
2649
|
-
}, 0);
|
2650
|
-
});
|
2651
2871
|
};
|
2652
2872
|
|
2653
2873
|
$.fn.slick = function() {
|
data/test/dummy/log/test.log
CHANGED
@@ -25,3 +25,24 @@ Started GET "/assets/jquery.slick.js" for 127.0.0.1 at 2015-12-02 15:50:13 +0300
|
|
25
25
|
Served asset /jquery.slick.js - 200 OK (3ms)
|
26
26
|
Started GET "/assets/jquery.slick.js" for 127.0.0.1 at 2015-12-02 15:50:13 +0300
|
27
27
|
Served asset /jquery.slick.js - 200 OK (0ms)
|
28
|
+
Started GET "/assets/slick-theme.css" for 127.0.0.1 at 2016-03-25 22:31:57 +0300
|
29
|
+
Served asset /slick-theme.css - 200 OK (42ms)
|
30
|
+
Started GET "/assets/slick.css" for 127.0.0.1 at 2016-03-25 22:31:57 +0300
|
31
|
+
Served asset /slick.css - 200 OK (5ms)
|
32
|
+
Started GET "/assets/slick.eot" for 127.0.0.1 at 2016-03-25 22:31:57 +0300
|
33
|
+
Served asset /slick.eot - 200 OK (0ms)
|
34
|
+
Started GET "/assets/jquery.slick.js" for 127.0.0.1 at 2016-03-25 22:31:57 +0300
|
35
|
+
Compiled jquery.slick.js (2ms) (pid 5612)
|
36
|
+
Served asset /jquery.slick.js - 200 OK (17ms)
|
37
|
+
Started GET "/assets/jquery.slick.js" for 127.0.0.1 at 2016-03-25 22:31:57 +0300
|
38
|
+
Served asset /jquery.slick.js - 200 OK (0ms)
|
39
|
+
Started GET "/assets/slick-theme.css" for 127.0.0.1 at 2016-03-25 22:32:59 +0300
|
40
|
+
Served asset /slick-theme.css - 200 OK (1ms)
|
41
|
+
Started GET "/assets/slick.css" for 127.0.0.1 at 2016-03-25 22:32:59 +0300
|
42
|
+
Served asset /slick.css - 200 OK (0ms)
|
43
|
+
Started GET "/assets/slick.eot" for 127.0.0.1 at 2016-03-25 22:32:59 +0300
|
44
|
+
Served asset /slick.eot - 200 OK (1ms)
|
45
|
+
Started GET "/assets/jquery.slick.js" for 127.0.0.1 at 2016-03-25 22:32:59 +0300
|
46
|
+
Served asset /jquery.slick.js - 200 OK (0ms)
|
47
|
+
Started GET "/assets/jquery.slick.js" for 127.0.0.1 at 2016-03-25 22:32:59 +0300
|
48
|
+
Served asset /jquery.slick.js - 200 OK (0ms)
|
Binary file
|
Binary file
|
Binary file
|
@@ -23,6 +23,6 @@ class NavigationTest < ActionDispatch::IntegrationTest
|
|
23
23
|
|
24
24
|
test 'slick response is for the expected version' do
|
25
25
|
get '/assets/jquery.slick.js'
|
26
|
-
assert_match(/Version: 1\.
|
26
|
+
assert_match(/Version: 1\.6\.0/, @response.body)
|
27
27
|
end
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-slick-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Bodrov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.2
|
33
|
+
version: '3.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.2
|
40
|
+
version: '3.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: test-unit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.1'
|
55
55
|
description: Integrates Slick carousel, a jQuery plugin by Ken Wheeler, into your
|
56
56
|
Rails app.
|
57
57
|
email:
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.6.1
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Integrates Slick carousel into Rails app.
|
@@ -153,4 +153,3 @@ test_files:
|
|
153
153
|
- test/integration/navigation_test.rb
|
154
154
|
- test/jquery-slick-rails_test.rb
|
155
155
|
- test/test_helper.rb
|
156
|
-
has_rdoc:
|