slick_rails 1.5.0 → 1.5.2

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: 42f17d1e85dbf014a16b0b481aa80917abb2652d
4
- data.tar.gz: 5bbf14fe6b0a1a51f81b29490c3854be54764064
3
+ metadata.gz: 5b4a1fe287c4857309ce87eab3f3cc9d0f8021dc
4
+ data.tar.gz: f81dda6d3c2d278f96a7ec581732bdb81aa51630
5
5
  SHA512:
6
- metadata.gz: 144c55d6116bb6e86d3517315fe287d8f6f693143782fbae75194186217441e4b366974b305a81e7c777d71d723d93b875973e2ac0e2a4d657a26a8dc6fd9860
7
- data.tar.gz: 871a5d7503d0c0376a051b899c2e226451dd72ff34b73d0357635437484ebe632f1264b25c644e764abe48be0093dde5c43cd6fe9f2645e88ac4fa40ba86c811
6
+ metadata.gz: 0cd9b1813833ee4756e2181148d565c3e68a09280caadee150badd25d4798e017d6c63b08158789854d7c0e574620fce6a42828cb97af1c10358442e21d15dcc
7
+ data.tar.gz: 4209ad272724e943ee92d2ef6bfec57e674ccf924f9ae4bf3688bef7005830bcf91c8f6ceecadbd94f0dd0a5f92d3ec5f0ebc0422c270a3096fe100f402bbf32
data/README.md CHANGED
@@ -43,6 +43,7 @@ If you want them make sure the asset pipeline will handle them with something li
43
43
  config.assets.precompile += %w( .js .css *.css.scss .svg .eot .woff .ttf)
44
44
 
45
45
  if you don't want them - ignore what I just wrote, and overwrite
46
+
46
47
  .slick-prev:before
47
48
  .slick-next:before
48
49
  .slick-dots li a:before
@@ -6,7 +6,7 @@
6
6
  |___/_|_|\___|_|\_(_)/ |___/
7
7
  |__/
8
8
 
9
- Version: 1.5.0
9
+ Version: 1.5.2
10
10
  Author: Ken Wheeler
11
11
  Website: http://kenwheeler.github.io
12
12
  Docs: http://kenwheeler.github.io/slick
@@ -168,9 +168,6 @@
168
168
  if (typeof document.mozHidden !== 'undefined') {
169
169
  _.hidden = 'mozHidden';
170
170
  _.visibilityChange = 'mozvisibilitychange';
171
- } else if (typeof document.msHidden !== 'undefined') {
172
- _.hidden = 'msHidden';
173
- _.visibilityChange = 'msvisibilitychange';
174
171
  } else if (typeof document.webkitHidden !== 'undefined') {
175
172
  _.hidden = 'webkitHidden';
176
173
  _.visibilityChange = 'webkitvisibilitychange';
@@ -606,6 +603,7 @@
606
603
  _.currentSlide = _.options.initialSlide;
607
604
  _.refresh();
608
605
  }
606
+ _.$slider.trigger('breakpoint', [_, targetBreakpoint]);
609
607
  }
610
608
  } else {
611
609
  _.activeBreakpoint = targetBreakpoint;
@@ -619,6 +617,7 @@
619
617
  _.currentSlide = _.options.initialSlide;
620
618
  _.refresh();
621
619
  }
620
+ _.$slider.trigger('breakpoint', [_, targetBreakpoint]);
622
621
  }
623
622
  } else {
624
623
  if (_.activeBreakpoint !== null) {
@@ -627,6 +626,7 @@
627
626
  if (initial === true)
628
627
  _.currentSlide = _.options.initialSlide;
629
628
  _.refresh();
629
+ _.$slider.trigger('breakpoint', [_, targetBreakpoint]);
630
630
  }
631
631
  }
632
632
 
@@ -707,8 +707,8 @@
707
707
 
708
708
  if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
709
709
  $('li', _.$dots)
710
- .off('mouseenter.slick', _.setPaused.bind(_, true))
711
- .off('mouseleave.slick', _.setPaused.bind(_, false));
710
+ .off('mouseenter.slick', $.proxy(_.setPaused, _, true))
711
+ .off('mouseleave.slick', $.proxy(_.setPaused, _, false));
712
712
  }
713
713
 
714
714
  if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
@@ -723,12 +723,10 @@
723
723
 
724
724
  _.$list.off('click.slick', _.clickHandler);
725
725
 
726
- if (_.options.autoplay === true) {
727
- $(document).off(_.visibilityChange, _.visibility);
728
- }
726
+ $(document).off(_.visibilityChange, _.visibility);
729
727
 
730
- _.$list.off('mouseenter.slick', _.setPaused.bind(_, true));
731
- _.$list.off('mouseleave.slick', _.setPaused.bind(_, false));
728
+ _.$list.off('mouseenter.slick', $.proxy(_.setPaused, _, true));
729
+ _.$list.off('mouseleave.slick', $.proxy(_.setPaused, _, false));
732
730
 
733
731
  if (_.options.accessibility === true) {
734
732
  _.$list.off('keydown.slick', _.keyHandler);
@@ -782,7 +780,7 @@
782
780
 
783
781
  _.cleanUpEvents();
784
782
 
785
- $('.slick-cloned', _.$slider).remove();
783
+ $('.slick-cloned', _.$slider).detach();
786
784
 
787
785
  if (_.$dots) {
788
786
  _.$dots.remove();
@@ -796,7 +794,7 @@
796
794
 
797
795
  if (_.$slides) {
798
796
  _.$slides.removeClass('slick-slide slick-active slick-center slick-visible')
799
- .attr('aria-hidden', 'true')
797
+ .removeAttr('aria-hidden')
800
798
  .removeAttr('data-slick-index')
801
799
  .css({
802
800
  position: '',
@@ -807,7 +805,13 @@
807
805
  width: ''
808
806
  });
809
807
 
810
- _.$slider.html(_.$slides);
808
+ _.$slideTrack.children(this.options.slide).detach();
809
+
810
+ _.$slideTrack.detach();
811
+
812
+ _.$list.detach();
813
+
814
+ _.$slider.append(_.$slides);
811
815
  }
812
816
 
813
817
  _.cleanUpRows();
@@ -902,7 +906,11 @@
902
906
  var pagerQty = 0;
903
907
 
904
908
  if (_.options.infinite === true) {
905
- pagerQty = Math.ceil(_.slideCount / _.options.slidesToScroll);
909
+ while (breakPoint < _.slideCount) {
910
+ ++pagerQty;
911
+ breakPoint = counter + _.options.slidesToShow;
912
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
913
+ }
906
914
  } else if (_.options.centerMode === true) {
907
915
  pagerQty = _.slideCount;
908
916
  } else {
@@ -1121,8 +1129,8 @@
1121
1129
 
1122
1130
  if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
1123
1131
  $('li', _.$dots)
1124
- .on('mouseenter.slick', _.setPaused.bind(_, true))
1125
- .on('mouseleave.slick', _.setPaused.bind(_, false));
1132
+ .on('mouseenter.slick', $.proxy(_.setPaused, _, true))
1133
+ .on('mouseleave.slick', $.proxy(_.setPaused, _, false));
1126
1134
  }
1127
1135
 
1128
1136
  };
@@ -1150,12 +1158,10 @@
1150
1158
 
1151
1159
  _.$list.on('click.slick', _.clickHandler);
1152
1160
 
1153
- if (_.options.autoplay === true) {
1154
- $(document).on(_.visibilityChange, _.visibility.bind(_));
1155
- }
1161
+ $(document).on(_.visibilityChange, $.proxy(_.visibility, _));
1156
1162
 
1157
- _.$list.on('mouseenter.slick', _.setPaused.bind(_, true));
1158
- _.$list.on('mouseleave.slick', _.setPaused.bind(_, false));
1163
+ _.$list.on('mouseenter.slick', $.proxy(_.setPaused, _, true));
1164
+ _.$list.on('mouseleave.slick', $.proxy(_.setPaused, _, false));
1159
1165
 
1160
1166
  if (_.options.accessibility === true) {
1161
1167
  _.$list.on('keydown.slick', _.keyHandler);
@@ -1165,9 +1171,9 @@
1165
1171
  $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1166
1172
  }
1167
1173
 
1168
- $(window).on('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange.bind(_));
1174
+ $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
1169
1175
 
1170
- $(window).on('resize.slick.slick-' + _.instanceUid, _.resize.bind(_));
1176
+ $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
1171
1177
 
1172
1178
  $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
1173
1179
 
@@ -1817,7 +1823,11 @@
1817
1823
 
1818
1824
  if (_.options.autoplay === true && _.options.pauseOnHover === true) {
1819
1825
  _.paused = paused;
1820
- _.autoPlayClear();
1826
+ if (!paused) {
1827
+ _.autoPlay();
1828
+ } else {
1829
+ _.autoPlayClear();
1830
+ }
1821
1831
  }
1822
1832
  };
1823
1833
 
@@ -2279,8 +2289,10 @@
2279
2289
  _.paused = true;
2280
2290
  _.autoPlayClear();
2281
2291
  } else {
2282
- _.paused = false;
2283
- _.autoPlay();
2292
+ if (_.options.autoplay === true) {
2293
+ _.paused = false;
2294
+ _.autoPlay();
2295
+ }
2284
2296
  }
2285
2297
 
2286
2298
  };
@@ -1,3 +1,3 @@
1
1
  module SlickRails
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.2"
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.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guy Israeli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler