jquery-slick-rails 1.8.1.1 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 586c716e35beb59e63f58cba39d5ea1a36c860f6af5cf0cf81713989780e599c
4
- data.tar.gz: 3fc8cf67c658f16b59aa157ac49c9c96cd17fd18ad7d67aa858431d1cd319e1e
3
+ metadata.gz: 8f0634443f41868def85a54ed12d1948f61c4a67ddbb0d15d36ba7a58228d67d
4
+ data.tar.gz: 41aa9235592ea2c1fb7ea3a77319a62e228efd88f4cd861ca1ecbb68be6fc3f6
5
5
  SHA512:
6
- metadata.gz: d52957b97bb53fc31f1f2aec8c49338133ed2f5d7c94b061a7f66c9dac51c602f957abcdc61a906d34b717a452c018a8fec46aa3ece87603210d24d4105b8a36
7
- data.tar.gz: 122735abfc4e7a9c4e63d39916bf401b207d35d02a41a78a64ec8e08fc1b753857cb303bb2d55a4953b400f8a2ed2f96595602c6bc2d021782fdd26d48b06115
6
+ metadata.gz: 1f102d51b93f05e5c3dd23c19837bba879f8daefd0cf02f22a9408a14ff340978d6947e65ec7f3a88cd92a202d5daa8d84753ad3c2339b9892bca8977596df95
7
+ data.tar.gz: bc12d6ed62ba58c356aa19ecfdea271e896ba23d19da5cfda2c67aecafe8e9b3304b6d3ba6dc6eddf3489f4971a0905edbb4836aef71c41b32f4e1ac741018d8
@@ -6,7 +6,7 @@
6
6
  |___/_|_|\___|_|\_(_)/ |___/
7
7
  |__/
8
8
 
9
- Version: 1.8.1
9
+ Version: 1.9.0
10
10
  Author: Ken Wheeler
11
11
  Website: http://kenwheeler.github.io
12
12
  Docs: http://kenwheeler.github.io/slick
@@ -66,7 +66,6 @@
66
66
  initialSlide: 0,
67
67
  lazyLoad: 'ondemand',
68
68
  mobileFirst: false,
69
- outerEdgeLimit: false,
70
69
  pauseOnHover: true,
71
70
  pauseOnFocus: true,
72
71
  pauseOnDotsHover: false,
@@ -1015,23 +1014,37 @@
1015
1014
 
1016
1015
  var _ = this;
1017
1016
 
1017
+ // If any child element receives focus within the slider we need to pause the autoplay
1018
1018
  _.$slider
1019
1019
  .off('focus.slick blur.slick')
1020
- .on('focus.slick blur.slick', '*', function(event) {
1021
-
1022
- event.stopImmediatePropagation();
1023
- var $sf = $(this);
1024
-
1025
- setTimeout(function() {
1026
-
1027
- if( _.options.pauseOnFocus ) {
1028
- _.focussed = $sf.is(':focus');
1029
- _.autoPlay();
1020
+ .on(
1021
+ 'focus.slick',
1022
+ '*',
1023
+ function(event) {
1024
+ var $sf = $(this);
1025
+
1026
+ setTimeout(function() {
1027
+ if( _.options.pauseOnFocus ) {
1028
+ if ($sf.is(':focus')) {
1029
+ _.focussed = true;
1030
+ _.autoPlay();
1031
+ }
1032
+ }
1033
+ }, 0);
1030
1034
  }
1035
+ ).on(
1036
+ 'blur.slick',
1037
+ '*',
1038
+ function(event) {
1039
+ var $sf = $(this);
1031
1040
 
1032
- }, 0);
1033
-
1034
- });
1041
+ // When a blur occurs on any elements within the slider we become unfocused
1042
+ if( _.options.pauseOnFocus ) {
1043
+ _.focussed = false;
1044
+ _.autoPlay();
1045
+ }
1046
+ }
1047
+ );
1035
1048
  };
1036
1049
 
1037
1050
  Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
@@ -1175,14 +1188,6 @@
1175
1188
  }
1176
1189
 
1177
1190
  targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
1178
- } else if (_.options.outerEdgeLimit) {
1179
- var lastSlide,
1180
- lastLeft,
1181
- outerEdgeLimit;
1182
- lastSlide = _.$slides.last();
1183
- lastLeft = lastSlide[0] ? lastSlide[0].offsetLeft * -1 : 0;
1184
- outerEdgeLimit = lastLeft - lastSlide.width() + this.$slider.width();
1185
- targetLeft = Math.min(Math.max(targetLeft, outerEdgeLimit), 0);
1186
1191
  }
1187
1192
  }
1188
1193
 
@@ -1233,13 +1238,25 @@
1233
1238
  Slick.prototype.getSlideCount = function() {
1234
1239
 
1235
1240
  var _ = this,
1236
- slidesTraversed, swipedSlide, centerOffset;
1241
+ slidesTraversed, swipedSlide, swipeTarget, centerOffset;
1237
1242
 
1238
- centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
1243
+ centerOffset = _.options.centerMode === true ? Math.floor(_.$list.width() / 2) : 0;
1244
+ swipeTarget = (_.swipeLeft * -1) + centerOffset;
1239
1245
 
1240
1246
  if (_.options.swipeToSlide === true) {
1247
+
1241
1248
  _.$slideTrack.find('.slick-slide').each(function(index, slide) {
1242
- if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
1249
+
1250
+ var slideOuterWidth, slideOffset, slideRightBoundary;
1251
+ slideOuterWidth = $(slide).outerWidth();
1252
+ slideOffset = slide.offsetLeft;
1253
+ if (_.options.centerMode !== true) {
1254
+ slideOffset += (slideOuterWidth / 2);
1255
+ }
1256
+
1257
+ slideRightBoundary = slideOffset + (slideOuterWidth);
1258
+
1259
+ if (swipeTarget < slideRightBoundary) {
1243
1260
  swipedSlide = slide;
1244
1261
  return false;
1245
1262
  }
@@ -1,3 +1,3 @@
1
1
  module JquerySlickRails
2
- VERSION = '1.8.1.1'
2
+ VERSION = '1.9.0'
3
3
  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.8.1.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Bodrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-23 00:00:00.000000000 Z
11
+ date: 2018-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties