slick_rails 1.3.5.1 → 1.3.6

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: 2bb0021b89cb1fde92cee002adab4606c5372921
4
- data.tar.gz: aab8e4f441302a4f28c082ee9a30488a5dde1fdb
3
+ metadata.gz: 9604bd2e1bd999aca49db421121334dbf6e7a094
4
+ data.tar.gz: 2791e84f728d1faf313ec653d9b0bd7d73dfa5ff
5
5
  SHA512:
6
- metadata.gz: f56edcabecdaa7dee98e06d55bf22d4509677e94a97fc069f90dc8e649b2a4169170a89386c87a8d85840a28df5782b96da8c48cfd618f2f3e732efb08ef2290
7
- data.tar.gz: e0ec7b5f6667fd974fc925e067e04449e8b7d2eddb90a3ac2a022d164ced1f4320b842c18ab24cec02fb7473d45f48fc8467fa02ed1b032d9f3c63d3db041c34
6
+ metadata.gz: c2f2057d9f0c0dff876cda32b499d60de8eafae92419fbb148dbe4f354ab3be09d6da4f2734a0c937c6f61f660d3cb916287081e8889fdbeec496b0332880245
7
+ data.tar.gz: 241539f7035be48337262d2910d84abb4d4e22fea40e3883f5814911ad9c3567389a0d08c753712c3c5edc2737809d77f05f1ae57d762e9a0a4d285f10b1fea3
@@ -6,6 +6,7 @@
6
6
  |___/_|_|\___|_|\_(_)/ |___/
7
7
  |__/
8
8
 
9
+ Version: 1.3.6
9
10
  Author: Ken Wheeler
10
11
  Website: http://kenwheeler.github.io
11
12
  Docs: http://kenwheeler.github.io/slick
@@ -67,6 +68,7 @@
67
68
  swipe: true,
68
69
  touchMove: true,
69
70
  touchThreshold: 5,
71
+ useCSS: true,
70
72
  vertical: false
71
73
  };
72
74
 
@@ -608,6 +610,14 @@
608
610
 
609
611
  };
610
612
 
613
+ Slick.prototype.getCurrent = function() {
614
+
615
+ var _ = this;
616
+
617
+ return _.currentSlide;
618
+
619
+ };
620
+
611
621
  Slick.prototype.getDotCount = function() {
612
622
 
613
623
  var _ = this,
@@ -631,23 +641,29 @@
631
641
  Slick.prototype.getLeft = function(slideIndex) {
632
642
 
633
643
  var _ = this,
634
- targetLeft;
644
+ targetLeft,
645
+ verticalHeight,
646
+ verticalOffset = 0;
635
647
 
636
648
  _.slideOffset = 0;
649
+ verticalHeight = _.$slides.first().outerHeight();
637
650
 
638
651
  if (_.options.infinite === true) {
639
652
  if (_.slideCount > _.options.slidesToShow) {
640
653
  _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
654
+ verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
641
655
  }
642
656
  if (_.slideCount % _.options.slidesToScroll !== 0) {
643
657
  if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
644
658
  _.slideOffset = ((_.slideCount % _.options.slidesToShow) * _.slideWidth) * -1;
659
+ verticalOffset = ((_.slideCount % _.options.slidesToShow) * verticalHeight) * -1;
645
660
  }
646
661
  }
647
662
  } else {
648
663
  if (_.slideCount % _.options.slidesToShow !== 0) {
649
664
  if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
650
- _.slideOffset = ((_.slideCount % _.options.slidesToShow) * _.slideWidth);
665
+ _.slideOffset = (_.options.slidesToShow * _.slideWidth) - ((_.slideCount % _.options.slidesToShow) * _.slideWidth);
666
+ verticalOffset = ((_.slideCount % _.options.slidesToShow) * verticalHeight);
651
667
  }
652
668
  }
653
669
  }
@@ -659,12 +675,7 @@
659
675
  if (_.options.vertical === false) {
660
676
  targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
661
677
  } else {
662
- _.listHeight = _.$list.height();
663
- if (_.options.infinite === true) {
664
- targetLeft = ((slideIndex * _.listHeight) * -1) - _.listHeight;
665
- } else {
666
- targetLeft = ((slideIndex * _.listHeight) * -1);
667
- }
678
+ targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
668
679
  }
669
680
 
670
681
  return targetLeft;
@@ -891,8 +902,6 @@
891
902
  _.autoPlay();
892
903
  }
893
904
 
894
- _.setSlideClasses(_.currentSlide);
895
-
896
905
  };
897
906
 
898
907
  Slick.prototype.progressiveLazyLoad = function() {
@@ -927,8 +936,7 @@
927
936
 
928
937
  var _ = this;
929
938
 
930
- _.$slides = $(_.options.slide +
931
- ':not(.slick-cloned)', _.$slideTrack).addClass(
939
+ _.$slides = _.$slideTrack.children(_.options.slide).addClass(
932
940
  'slick-slide');
933
941
 
934
942
  _.slideCount = _.$slides.length;
@@ -1039,8 +1047,8 @@
1039
1047
  });
1040
1048
  }
1041
1049
  } else {
1042
- _.$list.height(_.$slides.first().outerHeight());
1043
- _.$slideTrack.height(Math.ceil((_.listHeight * _
1050
+ _.$list.height(_.$slides.first().outerHeight() * _.options.slidesToShow);
1051
+ _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight() * _
1044
1052
  .$slideTrack.children('.slick-slide').length)));
1045
1053
  if (_.options.centerMode === true) {
1046
1054
  _.$list.css({
@@ -1104,7 +1112,9 @@
1104
1112
  if (document.body.style.WebkitTransition !== undefined ||
1105
1113
  document.body.style.MozTransition !== undefined ||
1106
1114
  document.body.style.msTransition !== undefined) {
1107
- _.cssTransitions = true;
1115
+ if(_.options.useCSS === true) {
1116
+ _.cssTransitions = true;
1117
+ }
1108
1118
  }
1109
1119
 
1110
1120
  if (document.body.style.MozTransform !== undefined) {
@@ -1133,8 +1143,12 @@
1133
1143
 
1134
1144
  _.listWidth = _.$list.width();
1135
1145
  _.listHeight = _.$list.height();
1146
+ if(_.options.vertical === false) {
1136
1147
  _.slideWidth = Math.ceil(_.listWidth / _.options
1137
1148
  .slidesToShow);
1149
+ } else {
1150
+ _.slideWidth = Math.ceil(_.listWidth);
1151
+ }
1138
1152
 
1139
1153
  };
1140
1154
 
@@ -1170,7 +1184,7 @@
1170
1184
  if (index > 0 && index < (_.slideCount - _.options.slidesToShow)) {
1171
1185
  _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active');
1172
1186
  } else {
1173
- indexOffset = _.options.slidesToShow + index;
1187
+ indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
1174
1188
  allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active');
1175
1189
  }
1176
1190
 
@@ -1188,8 +1202,6 @@
1188
1202
  i, slideIndex, infiniteCount;
1189
1203
 
1190
1204
  if (_.options.fade === true || _.options.vertical === true) {
1191
- _.options.slidesToShow = 1;
1192
- _.options.slidesToScroll = 1;
1193
1205
  _.options.centerMode = false;
1194
1206
  }
1195
1207
 
@@ -1244,10 +1256,12 @@
1244
1256
  _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
1245
1257
 
1246
1258
  if (_.options.infinite === false && (index < 0 || index > (_.slideCount - _.options.slidesToShow + unevenOffset))) {
1247
- targetSlide = _.currentSlide;
1248
- _.animateSlide(slideLeft, function() {
1249
- _.postSlide(targetSlide);
1250
- });
1259
+ if(_.options.fade === false) {
1260
+ targetSlide = _.currentSlide;
1261
+ _.animateSlide(slideLeft, function() {
1262
+ _.postSlide(targetSlide);
1263
+ });
1264
+ }
1251
1265
  return false;
1252
1266
  }
1253
1267
 
@@ -1274,6 +1288,9 @@
1274
1288
  }
1275
1289
 
1276
1290
  _.currentSlide = animSlide;
1291
+
1292
+ _.setSlideClasses(_.currentSlide);
1293
+
1277
1294
  _.updateDots();
1278
1295
  _.updateArrows();
1279
1296
 
@@ -1383,7 +1400,7 @@
1383
1400
  if ('ontouchend' in document && _.options.swipe === false) {
1384
1401
  return false;
1385
1402
  } else if (_.options.draggable === false && !event.originalEvent.touches) {
1386
- return false;
1403
+ return true;
1387
1404
  }
1388
1405
 
1389
1406
  _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
@@ -1445,7 +1462,7 @@
1445
1462
  _.swipeLeft = curLeft + _.touchObject.swipeLength * positionOffset;
1446
1463
  } else {
1447
1464
  _.swipeLeft = curLeft + (_.touchObject
1448
- .swipeLength * (_.listHeight / _.listWidth)) * positionOffset;
1465
+ .swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
1449
1466
  }
1450
1467
 
1451
1468
  if (_.options.fade === true || _.options.touchMove === false) {
@@ -1568,6 +1585,11 @@
1568
1585
  });
1569
1586
  };
1570
1587
 
1588
+ $.fn.slickCurrentSlide = function() {
1589
+ var _ = this;
1590
+ return _.get(0).slick.getCurrent();
1591
+ };
1592
+
1571
1593
  $.fn.slickFilter = function(filter) {
1572
1594
  var _ = this;
1573
1595
  return _.each(function(index, element) {
@@ -1,3 +1,3 @@
1
1
  module SlickRails
2
- VERSION = "1.3.5.1"
2
+ VERSION = "1.3.6"
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.5.1
4
+ version: 1.3.6
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-04-25 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler