lory-rails 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSIONS.md +1 -0
- data/lib/lory/rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.lory.js +16 -7
- data/vendor/assets/javascripts/lory.js +16 -7
- 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: 5327acfeb94c62b926ec12ece57ec3cf14a6bb0e
|
4
|
+
data.tar.gz: 28c23f3f8af8df43d8b2df3288b08270aeda0ddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307d53c648d4d56ffcf797b79686bbc686eada001ddc9d105e3bca10b6d3c8b1256ff9b68ddeae8c8b9332e1eacd94b302848e127eebd7dedd427643cc7c331e
|
7
|
+
data.tar.gz: f262abf10f99b9e82e075175706d73d7aae76ff00738aad8bb228ce46c7d8851a9cd3e8d0c57d6d3ae7978b0b462d779c05e5eb8c751b891ac47218887faec23
|
data/VERSIONS.md
CHANGED
data/lib/lory/rails/version.rb
CHANGED
@@ -242,6 +242,13 @@ function lory(slider, opts) {
|
|
242
242
|
}
|
243
243
|
}
|
244
244
|
|
245
|
+
/**
|
246
|
+
* returns an element's width
|
247
|
+
*/
|
248
|
+
function elementWidth(element) {
|
249
|
+
return element.getBoundingClientRect().width || element.offsetWidth;
|
250
|
+
}
|
251
|
+
|
245
252
|
/**
|
246
253
|
* slidefunction called by prev, next & touchend
|
247
254
|
*
|
@@ -448,12 +455,12 @@ function lory(slider, opts) {
|
|
448
455
|
initialIndex = _options5.initialIndex;
|
449
456
|
|
450
457
|
|
451
|
-
slidesWidth = slideContainer
|
452
|
-
frameWidth = frame
|
458
|
+
slidesWidth = elementWidth(slideContainer);
|
459
|
+
frameWidth = elementWidth(frame);
|
453
460
|
|
454
461
|
if (frameWidth === slidesWidth) {
|
455
462
|
slidesWidth = slides.reduce(function (previousValue, slide) {
|
456
|
-
return previousValue + slide
|
463
|
+
return previousValue + elementWidth(slide);
|
457
464
|
}, 0);
|
458
465
|
}
|
459
466
|
|
@@ -687,11 +694,13 @@ function lory(slider, opts) {
|
|
687
694
|
}
|
688
695
|
|
689
696
|
function onResize(event) {
|
690
|
-
|
697
|
+
if (frameWidth !== elementWidth(frame)) {
|
698
|
+
reset();
|
691
699
|
|
692
|
-
|
693
|
-
|
694
|
-
|
700
|
+
dispatchSliderEvent('on', 'resize', {
|
701
|
+
event: event
|
702
|
+
});
|
703
|
+
}
|
695
704
|
}
|
696
705
|
|
697
706
|
// trigger initial setup
|
@@ -242,6 +242,13 @@ function lory(slider, opts) {
|
|
242
242
|
}
|
243
243
|
}
|
244
244
|
|
245
|
+
/**
|
246
|
+
* returns an element's width
|
247
|
+
*/
|
248
|
+
function elementWidth(element) {
|
249
|
+
return element.getBoundingClientRect().width || element.offsetWidth;
|
250
|
+
}
|
251
|
+
|
245
252
|
/**
|
246
253
|
* slidefunction called by prev, next & touchend
|
247
254
|
*
|
@@ -448,12 +455,12 @@ function lory(slider, opts) {
|
|
448
455
|
initialIndex = _options5.initialIndex;
|
449
456
|
|
450
457
|
|
451
|
-
slidesWidth = slideContainer
|
452
|
-
frameWidth = frame
|
458
|
+
slidesWidth = elementWidth(slideContainer);
|
459
|
+
frameWidth = elementWidth(frame);
|
453
460
|
|
454
461
|
if (frameWidth === slidesWidth) {
|
455
462
|
slidesWidth = slides.reduce(function (previousValue, slide) {
|
456
|
-
return previousValue + slide
|
463
|
+
return previousValue + elementWidth(slide);
|
457
464
|
}, 0);
|
458
465
|
}
|
459
466
|
|
@@ -687,11 +694,13 @@ function lory(slider, opts) {
|
|
687
694
|
}
|
688
695
|
|
689
696
|
function onResize(event) {
|
690
|
-
|
697
|
+
if (frameWidth !== elementWidth(frame)) {
|
698
|
+
reset();
|
691
699
|
|
692
|
-
|
693
|
-
|
694
|
-
|
700
|
+
dispatchSliderEvent('on', 'resize', {
|
701
|
+
event: event
|
702
|
+
});
|
703
|
+
}
|
695
704
|
}
|
696
705
|
|
697
706
|
// trigger initial setup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lory-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tanvir hasan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|