slick_rails 1.3.8 → 1.3.11
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/slick.js +40 -14
- data/app/assets/stylesheets/slick.css.scss +2 -1
- data/lib/slick_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75a32286f08ba88dd517a43bca47213d0f3a928d
|
4
|
+
data.tar.gz: 114afcc790034c552d3f0e3fa2ea1ec5129fd1bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4490fcfcb246d1569286374dcfe5522bc2ca9ca2a756028da93f70733c473728ddf5fe598c2d7b86d1c2116176a3211f896c4a76acbf3433d1f7f5ef568e6b86
|
7
|
+
data.tar.gz: bb1dd85c23b9e5f4d4bd87f52a3548522a694fb0630ee0cf0ebc37462766d83a15843379c36f320b4e4e0c74c6c631dfb64300a9b1f42f35600c755c2f5d917d
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|___/_|_|\___|_|\_(_)/ |___/
|
7
7
|
|__/
|
8
8
|
|
9
|
-
Version: 1.3.
|
9
|
+
Version: 1.3.11
|
10
10
|
Author: Ken Wheeler
|
11
11
|
Website: http://kenwheeler.github.io
|
12
12
|
Docs: http://kenwheeler.github.io/slick
|
@@ -619,7 +619,7 @@
|
|
619
619
|
|
620
620
|
};
|
621
621
|
|
622
|
-
Slick.prototype.fadeSlide = function(slideIndex, callback) {
|
622
|
+
Slick.prototype.fadeSlide = function(oldSlide, slideIndex, callback) {
|
623
623
|
|
624
624
|
var _ = this;
|
625
625
|
|
@@ -633,19 +633,29 @@
|
|
633
633
|
opacity: 1
|
634
634
|
}, _.options.speed, _.options.easing, callback);
|
635
635
|
|
636
|
+
_.$slides.eq(oldSlide).animate({
|
637
|
+
opacity: 0
|
638
|
+
}, _.options.speed, _.options.easing);
|
639
|
+
|
636
640
|
} else {
|
637
641
|
|
638
642
|
_.applyTransition(slideIndex);
|
643
|
+
_.applyTransition(oldSlide);
|
639
644
|
|
640
645
|
_.$slides.eq(slideIndex).css({
|
641
646
|
opacity: 1,
|
642
647
|
zIndex: 1000
|
643
648
|
});
|
644
649
|
|
650
|
+
_.$slides.eq(oldSlide).css({
|
651
|
+
opacity: 0
|
652
|
+
});
|
653
|
+
|
645
654
|
if (callback) {
|
646
655
|
setTimeout(function() {
|
647
656
|
|
648
657
|
_.disableTransition(slideIndex);
|
658
|
+
_.disableTransition(oldSlide);
|
649
659
|
|
650
660
|
callback.call();
|
651
661
|
}, _.options.speed);
|
@@ -717,9 +727,6 @@
|
|
717
727
|
if (_.slideCount > _.options.slidesToShow) {
|
718
728
|
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
|
719
729
|
verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
|
720
|
-
} else {
|
721
|
-
_.slideOffset = 0;
|
722
|
-
verticalOffset = 0;
|
723
730
|
}
|
724
731
|
if (_.slideCount % _.options.slidesToScroll !== 0) {
|
725
732
|
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
|
@@ -736,6 +743,11 @@
|
|
736
743
|
}
|
737
744
|
}
|
738
745
|
|
746
|
+
if (_.slideCount <= _.options.slidesToShow){
|
747
|
+
_.slideOffset = 0;
|
748
|
+
verticalOffset = 0;
|
749
|
+
}
|
750
|
+
|
739
751
|
if (_.options.centerMode === true && _.options.infinite === true) {
|
740
752
|
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
|
741
753
|
} else if (_.options.centerMode === true) {
|
@@ -749,11 +761,20 @@
|
|
749
761
|
}
|
750
762
|
|
751
763
|
if (_.options.variableWidth === true) {
|
752
|
-
|
753
|
-
|
764
|
+
|
765
|
+
if(_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
|
766
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
|
767
|
+
} else {
|
768
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
|
769
|
+
}
|
770
|
+
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
|
754
771
|
if (_.options.centerMode === true) {
|
755
|
-
|
756
|
-
|
772
|
+
if(_.options.infinite === false) {
|
773
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
|
774
|
+
} else {
|
775
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
|
776
|
+
}
|
777
|
+
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
|
757
778
|
targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
|
758
779
|
}
|
759
780
|
}
|
@@ -1057,6 +1078,10 @@
|
|
1057
1078
|
_.currentSlide = _.currentSlide - _.options.slidesToScroll;
|
1058
1079
|
}
|
1059
1080
|
|
1081
|
+
if (_.slideCount <= _.options.slidesToShow) {
|
1082
|
+
_.currentSlide = 0;
|
1083
|
+
}
|
1084
|
+
|
1060
1085
|
_.setProps();
|
1061
1086
|
|
1062
1087
|
_.setupInfinite();
|
@@ -1176,9 +1201,9 @@
|
|
1176
1201
|
} else if (_.options.variableWidth === true) {
|
1177
1202
|
_.slideWidth = 0;
|
1178
1203
|
_.$slideTrack.children('.slick-slide').each(function(){
|
1179
|
-
_.slideWidth += $(this).outerWidth();
|
1204
|
+
_.slideWidth += Math.ceil($(this).outerWidth(true));
|
1180
1205
|
});
|
1181
|
-
_.$slideTrack.width(Math.ceil(_.slideWidth));
|
1206
|
+
_.$slideTrack.width(Math.ceil(_.slideWidth) + 1);
|
1182
1207
|
} else {
|
1183
1208
|
_.slideWidth = Math.ceil(_.listWidth);
|
1184
1209
|
_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
|
@@ -1408,7 +1433,7 @@
|
|
1408
1433
|
|
1409
1434
|
Slick.prototype.slideHandler = function(index,sync) {
|
1410
1435
|
|
1411
|
-
var targetSlide, animSlide, slideLeft, unevenOffset, targetLeft = null,
|
1436
|
+
var targetSlide, animSlide, oldSlide, slideLeft, unevenOffset, targetLeft = null,
|
1412
1437
|
_ = this;
|
1413
1438
|
|
1414
1439
|
sync = sync || false;
|
@@ -1473,6 +1498,7 @@
|
|
1473
1498
|
_.options.onBeforeChange.call(this, _, _.currentSlide, animSlide);
|
1474
1499
|
}
|
1475
1500
|
|
1501
|
+
oldSlide = _.currentSlide;
|
1476
1502
|
_.currentSlide = animSlide;
|
1477
1503
|
|
1478
1504
|
_.setSlideClasses(_.currentSlide);
|
@@ -1481,7 +1507,7 @@
|
|
1481
1507
|
_.updateArrows();
|
1482
1508
|
|
1483
1509
|
if (_.options.fade === true) {
|
1484
|
-
_.fadeSlide(animSlide, function() {
|
1510
|
+
_.fadeSlide(oldSlide,animSlide, function() {
|
1485
1511
|
_.postSlide(animSlide);
|
1486
1512
|
});
|
1487
1513
|
return false;
|
@@ -1798,7 +1824,7 @@
|
|
1798
1824
|
element.slick.changeSlide({
|
1799
1825
|
data: {
|
1800
1826
|
message: 'index',
|
1801
|
-
index: slide
|
1827
|
+
index: parseInt(slide)
|
1802
1828
|
}
|
1803
1829
|
});
|
1804
1830
|
|
data/lib/slick_rails/version.rb
CHANGED
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.
|
4
|
+
version: 1.3.11
|
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-10-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|