slick_rails 1.3.6.3 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8ba246b453d6faa9a9125853f57453587b88f87
4
- data.tar.gz: 736ef2d9abe990517011b55fbc6a8075e692b1b2
3
+ metadata.gz: 62e54ab415c3c88119260d7dfe76d2dc3af3d704
4
+ data.tar.gz: 8c66cde7cdbcdefc432c13d0bbf410cb4d93ccf3
5
5
  SHA512:
6
- metadata.gz: c37336050ec29b11c4c9e12d01b056be4650207f1d7f360e259a0085fb2bcafda3a8f89f4b93beb074600fbfbba2b516e51a0236041a98332ca47b5b5833e43c
7
- data.tar.gz: fbb5e6bdd572e59ad6f6a2ba7cb1c648a9c9943f7b107472a4e6a7406bbf36259c82eaba902b19d22ca274a261343020bd24c55b497a4c4d7b498a0fa60b109c
6
+ metadata.gz: ede57036dbe925aa6d57b06ad6d22dfdee4e080f8f054d371d9fd318a701279906759d256ba46ef907ccea84442cb0c06390f0ae85066d1b5a537a649a605e90
7
+ data.tar.gz: 6451c7d94067d30d14b3b3ec33776e8bfb50517e2460507a94ded94d7ca587e7c53ce536371adb10582925005e19745407aed3cae150c30a4acac039e776dd5d
@@ -6,7 +6,7 @@
6
6
  |___/_|_|\___|_|\_(_)/ |___/
7
7
  |__/
8
8
 
9
- Version: 1.3.6
9
+ Version: 1.3.7
10
10
  Author: Ken Wheeler
11
11
  Website: http://kenwheeler.github.io
12
12
  Docs: http://kenwheeler.github.io/slick
@@ -43,17 +43,18 @@
43
43
  appendArrows: $(element),
44
44
  arrows: true,
45
45
  asNavFor: null,
46
- prevArrow: '<button type="button" class="slick-prev">Previous</button>',
47
- nextArrow: '<button type="button" class="slick-next">Next</button>',
46
+ prevArrow: '<button type="button" data-role="none" class="slick-prev">Previous</button>',
47
+ nextArrow: '<button type="button" data-role="none" class="slick-next">Next</button>',
48
48
  autoplay: false,
49
49
  autoplaySpeed: 3000,
50
50
  centerMode: false,
51
51
  centerPadding: '50px',
52
52
  cssEase: 'ease',
53
53
  customPaging: function(slider, i) {
54
- return '<button type="button">' + (i + 1) + '</button>';
54
+ return '<button type="button" data-role="none">' + (i + 1) + '</button>';
55
55
  },
56
56
  dots: false,
57
+ dotsClass: 'slick-dots',
57
58
  draggable: true,
58
59
  easing: 'linear',
59
60
  fade: false,
@@ -67,6 +68,7 @@
67
68
  pauseOnHover: true,
68
69
  pauseOnDotsHover: false,
69
70
  responsive: null,
71
+ rtl: false,
70
72
  slide: 'div',
71
73
  slidesToShow: 1,
72
74
  slidesToScroll: 1,
@@ -196,7 +198,7 @@
196
198
 
197
199
  _.$slides = _.$slideTrack.children(this.options.slide);
198
200
 
199
- _.$slideTrack.children(this.options.slide).remove();
201
+ _.$slideTrack.children(this.options.slide).detach();
200
202
 
201
203
  _.$slideTrack.append(_.$slides);
202
204
 
@@ -210,11 +212,13 @@
210
212
 
211
213
  };
212
214
 
213
- Slick.prototype.animateSlide = function(targetLeft,
214
- callback) {
215
+ Slick.prototype.animateSlide = function(targetLeft, callback) {
215
216
 
216
217
  var animProps = {}, _ = this;
217
218
 
219
+ if (_.options.rtl === true && _.options.vertical === false) {
220
+ targetLeft = -targetLeft;
221
+ }
218
222
  if (_.transformsEnabled === false) {
219
223
  if (_.options.vertical === false) {
220
224
  _.$slideTrack.animate({
@@ -396,7 +400,7 @@
396
400
 
397
401
  if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
398
402
 
399
- dotString = '<ul class="slick-dots">';
403
+ dotString = '<ul class="' + _.options.dotsClass + '">';
400
404
 
401
405
  for (i = 0; i <= _.getDotCount(); i += 1) {
402
406
  dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
@@ -573,7 +577,7 @@
573
577
  _.$nextArrow.remove();
574
578
  }
575
579
  if (_.$slides.parent().hasClass('slick-track')) {
576
- _.$slides.unwrap().unwrap();
580
+ _.$slides.unwrap().unwrap();
577
581
  }
578
582
  _.$slides.removeClass(
579
583
  'slick-slide slick-active slick-visible').removeAttr('style');
@@ -582,6 +586,8 @@
582
586
 
583
587
  _.$list.off('.slick');
584
588
  $(window).off('.slick-' + _.instanceUid);
589
+ $(document).off('.slick-' + _.instanceUid);
590
+
585
591
  };
586
592
 
587
593
  Slick.prototype.disableTransition = function(slide) {
@@ -643,7 +649,7 @@
643
649
 
644
650
  _.unload();
645
651
 
646
- _.$slideTrack.children(this.options.slide).remove();
652
+ _.$slideTrack.children(this.options.slide).detach();
647
653
 
648
654
  _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
649
655
 
@@ -821,7 +827,7 @@
821
827
  });
822
828
 
823
829
  $(window).on('resize.slick.slick-' + _.instanceUid, function() {
824
- if ($(window).width !== _.windowWidth) {
830
+ if ($(window).width() !== _.windowWidth) {
825
831
  clearTimeout(_.windowDelay);
826
832
  _.windowDelay = window.setTimeout(function() {
827
833
  _.windowWidth = $(window).width();
@@ -889,14 +895,14 @@
889
895
  function loadImages(imagesScope) {
890
896
  $('img[data-lazy]', imagesScope).each(function() {
891
897
  var image = $(this),
892
- imageSource = $(this).attr('data-lazy');
898
+ imageSource = $(this).attr('data-lazy') + "?" + new Date().getTime();
893
899
 
894
900
  image
901
+ .load(function() { image.animate({ opacity: 1 }, 200); })
895
902
  .css({ opacity: 0 })
896
903
  .attr('src', imageSource)
897
904
  .removeAttr('data-lazy')
898
- .removeClass('slick-loading')
899
- .load(function() { image.animate({ opacity: 1 }, 200); });
905
+ .removeClass('slick-loading');
900
906
  });
901
907
  }
902
908
 
@@ -911,6 +917,10 @@
911
917
  loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
912
918
  loadImages(loadRange);
913
919
 
920
+ if (_.slideCount == 1){
921
+ cloneRange = _.$slider.find('.slick-slide')
922
+ loadImages(cloneRange)
923
+ }else
914
924
  if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
915
925
  cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
916
926
  loadImages(cloneRange)
@@ -1056,7 +1066,7 @@
1056
1066
 
1057
1067
  _.$slides = _.$slideTrack.children(this.options.slide);
1058
1068
 
1059
- _.$slideTrack.children(this.options.slide).remove();
1069
+ _.$slideTrack.children(this.options.slide).detach();
1060
1070
 
1061
1071
  _.$slideTrack.append(_.$slides);
1062
1072
 
@@ -1071,6 +1081,9 @@
1071
1081
  var _ = this,
1072
1082
  positionProps = {}, x, y;
1073
1083
 
1084
+ if (_.options.rtl === true) {
1085
+ position = -position;
1086
+ }
1074
1087
  x = _.positionProp == 'left' ? position + 'px' : '0px';
1075
1088
  y = _.positionProp == 'top' ? position + 'px' : '0px';
1076
1089
 
@@ -1095,25 +1108,14 @@
1095
1108
 
1096
1109
  var _ = this;
1097
1110
 
1098
- if (_.options.centerMode === true) {
1099
- _.$slideTrack.children('.slick-slide').width(_.slideWidth);
1100
- } else {
1101
- _.$slideTrack.children('.slick-slide').width(_.slideWidth);
1102
- }
1103
-
1104
-
1105
1111
  if (_.options.vertical === false) {
1106
- _.$slideTrack.width(Math.ceil((_.slideWidth * _
1107
- .$slideTrack.children('.slick-slide').length)));
1108
1112
  if (_.options.centerMode === true) {
1109
1113
  _.$list.css({
1110
1114
  padding: ('0px ' + _.options.centerPadding)
1111
1115
  });
1112
1116
  }
1113
1117
  } else {
1114
- _.$list.height(_.$slides.first().outerHeight() * _.options.slidesToShow);
1115
- _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight() * _
1116
- .$slideTrack.children('.slick-slide').length)));
1118
+ _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
1117
1119
  if (_.options.centerMode === true) {
1118
1120
  _.$list.css({
1119
1121
  padding: (_.options.centerPadding + ' 0px')
@@ -1121,6 +1123,23 @@
1121
1123
  }
1122
1124
  }
1123
1125
 
1126
+ _.listWidth = _.$list.width();
1127
+ _.listHeight = _.$list.height();
1128
+
1129
+
1130
+ if(_.options.vertical === false) {
1131
+ _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1132
+ _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
1133
+
1134
+ } else {
1135
+ _.slideWidth = Math.ceil(_.listWidth);
1136
+ _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
1137
+
1138
+ }
1139
+
1140
+ var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
1141
+ _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
1142
+
1124
1143
  };
1125
1144
 
1126
1145
  Slick.prototype.setFade = function() {
@@ -1150,7 +1169,6 @@
1150
1169
 
1151
1170
  var _ = this;
1152
1171
 
1153
- _.setValues();
1154
1172
  _.setDimensions();
1155
1173
 
1156
1174
  if (_.options.fade === false) {
@@ -1192,6 +1210,11 @@
1192
1210
  _.transitionType = 'webkitTransition';
1193
1211
  }
1194
1212
  if (document.body.style.msTransform !== undefined) {
1213
+ _.animType = 'msTransform';
1214
+ _.transformType = "-ms-transform";
1215
+ _.transitionType = 'msTransition';
1216
+ }
1217
+ if (document.body.style.transform !== undefined) {
1195
1218
  _.animType = 'transform';
1196
1219
  _.transformType = "transform";
1197
1220
  _.transitionType = 'transition';
@@ -1201,25 +1224,11 @@
1201
1224
 
1202
1225
  };
1203
1226
 
1204
- Slick.prototype.setValues = function() {
1205
-
1206
- var _ = this;
1207
-
1208
- _.listWidth = _.$list.width();
1209
- _.listHeight = _.$list.height();
1210
- if(_.options.vertical === false) {
1211
- _.slideWidth = Math.ceil(_.listWidth / _.options
1212
- .slidesToShow);
1213
- } else {
1214
- _.slideWidth = Math.ceil(_.listWidth);
1215
- }
1216
-
1217
- };
1218
1227
 
1219
1228
  Slick.prototype.setSlideClasses = function(index) {
1220
1229
 
1221
1230
  var _ = this,
1222
- centerOffset, allSlides, indexOffset;
1231
+ centerOffset, allSlides, indexOffset, remainder;
1223
1232
 
1224
1233
  _.$slider.find('.slick-slide').removeClass('slick-active').removeClass('slick-center');
1225
1234
  allSlides = _.$slider.find('.slick-slide');
@@ -1249,13 +1258,18 @@
1249
1258
 
1250
1259
  } else {
1251
1260
 
1252
- if (index > 0 && index < (_.slideCount - _.options.slidesToShow)) {
1261
+ if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
1253
1262
  _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active');
1254
1263
  } else if ( allSlides.length <= _.options.slidesToShow ) {
1255
1264
  allSlides.addClass('slick-active');
1256
1265
  } else {
1266
+ remainder = _.slideCount%_.options.slidesToShow;
1257
1267
  indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
1258
- allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active');
1268
+ if(_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
1269
+ allSlides.slice(indexOffset-(_.options.slidesToShow-remainder), indexOffset + remainder).addClass('slick-active');
1270
+ } else {
1271
+ allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active');
1272
+ }
1259
1273
  }
1260
1274
 
1261
1275
  }
@@ -1290,12 +1304,12 @@
1290
1304
  for (i = _.slideCount; i > (_.slideCount -
1291
1305
  infiniteCount); i -= 1) {
1292
1306
  slideIndex = i - 1;
1293
- $(_.$slides[slideIndex]).clone().attr('id', '').prependTo(
1307
+ $(_.$slides[slideIndex]).clone(true).attr('id', '').prependTo(
1294
1308
  _.$slideTrack).addClass('slick-cloned');
1295
1309
  }
1296
1310
  for (i = 0; i < infiniteCount; i += 1) {
1297
1311
  slideIndex = i;
1298
- $(_.$slides[slideIndex]).clone().attr('id', '').appendTo(
1312
+ $(_.$slides[slideIndex]).clone(true).attr('id', '').appendTo(
1299
1313
  _.$slideTrack).addClass('slick-cloned');
1300
1314
  }
1301
1315
  _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
@@ -1609,7 +1623,7 @@
1609
1623
 
1610
1624
  _.unload();
1611
1625
 
1612
- _.$slideTrack.children(this.options.slide).remove();
1626
+ _.$slideTrack.children(this.options.slide).detach();
1613
1627
 
1614
1628
  _.$slidesCache.appendTo(_.$slideTrack);
1615
1629
 
@@ -1809,7 +1823,7 @@
1809
1823
  var s = null;
1810
1824
  var _ = this;
1811
1825
  _.each(function(index, element) {
1812
- s = element.slick
1826
+ s = element.slick;
1813
1827
  });
1814
1828
 
1815
1829
  return s;
@@ -49,7 +49,6 @@ $opacity-not-active: .25;
49
49
  -ms-user-select: none;
50
50
  user-select: none;
51
51
  -ms-touch-action: none;
52
- touch-action: none;
53
52
  -webkit-tap-highlight-color: transparent;
54
53
  }
55
54
  .slick-list {
@@ -107,6 +106,9 @@ $opacity-not-active: .25;
107
106
  float: left;
108
107
  height: 100%;
109
108
  min-height: 1px;
109
+ [dir="rtl"] & {
110
+ float: right;
111
+ }
110
112
  img {
111
113
  display: block;
112
114
  }
@@ -190,14 +192,28 @@ $opacity-not-active: .25;
190
192
  }
191
193
  .slick-prev {
192
194
  left: -25px;
195
+ [dir="rtl"] & {
196
+ left: auto;
197
+ right: -25px;
198
+ }
193
199
  &:before {
194
200
  content: $slick-prev-character;
201
+ [dir="rtl"] & {
202
+ content: $slick-next-character;
203
+ }
195
204
  }
196
205
  }
197
206
  .slick-next {
198
207
  right: -25px;
208
+ [dir="rtl"] & {
209
+ left: -25px;
210
+ right: auto;
211
+ }
199
212
  &:before {
200
213
  content: $slick-next-character;
214
+ [dir="rtl"] & {
215
+ content: $slick-prev-character;
216
+ }
201
217
  }
202
218
  }
203
219
 
@@ -1,3 +1,3 @@
1
1
  module SlickRails
2
- VERSION = "1.3.6.3"
2
+ VERSION = "1.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slick_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6.3
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guy Israeli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-27 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler