lory-rails 0.1.4 → 0.2.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
  SHA1:
3
- metadata.gz: 116401ee2e8af93de8480a2ef4d12c5166b0cbbf
4
- data.tar.gz: b0c21d3d5c2d8a43ae81cff85a7f05f03807a7c2
3
+ metadata.gz: 03e490ca9f7a3fefaa91d4459eba6791ec9c364a
4
+ data.tar.gz: 20ed2657a319b4607ecf6740aa79a34c3163f383
5
5
  SHA512:
6
- metadata.gz: 42a10f0876509104b0f5d28fd2769ee737c68dc24565af1c0daeb4fed2ce2a5b0b84c50fb16124b43730dde2e785dd4d56e80237d49b74c220f3f8126089a3b9
7
- data.tar.gz: 0b6f007cc9d369cdbffcc7fddc7ab843138ecedbc8236c5bf63365a049bbf40c87edb92bc6c0c14632ab3b490140f5691583342d0e5293843c663429ef97e04d
6
+ metadata.gz: 24408fa4543dd7538f72405c0138868079d6ea5d9b2eacac5320b51bfd97532dc0db49cd561dd7350d12d57684ce6b7fe50e48b20d9448863f623128f9da73d0
7
+ data.tar.gz: 6cdb6880244b613ae122eafd9c1fcea80a80af48963d085034fa2b1c2a4bdc3134d01e1865f1adc6d88c36b05cefd6ed2da85e587bf028833b5e4cc51c4311f2
@@ -7,3 +7,4 @@
7
7
  | 0.1.2 | 2.4.2
8
8
  | 0.1.3 | 2.4.3
9
9
  | 0.1.4 | 2.4.4
10
+ | 0.2.0 | 2.5.0
@@ -1,5 +1,5 @@
1
1
  module Lory
2
2
  module Rails
3
- VERSION = "0.1.4"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -283,9 +283,17 @@ function lory(slider, opts) {
283
283
 
284
284
  if (typeof nextIndex !== 'number') {
285
285
  if (direction) {
286
- nextIndex = index + slidesToScroll;
286
+ if (infinite && index + infinite * 2 !== slides.length) {
287
+ nextIndex = index + (infinite - index % infinite);
288
+ } else {
289
+ nextIndex = index + slidesToScroll;
290
+ }
287
291
  } else {
288
- nextIndex = index - slidesToScroll;
292
+ if (infinite && index % infinite !== 0) {
293
+ nextIndex = index - index % infinite;
294
+ } else {
295
+ nextIndex = index - slidesToScroll;
296
+ }
289
297
  }
290
298
  }
291
299
 
@@ -321,7 +329,7 @@ function lory(slider, opts) {
321
329
  index = nextIndex;
322
330
  }
323
331
 
324
- if (infinite && (nextIndex === slides.length - infinite || nextIndex === 0)) {
332
+ if (infinite && (nextIndex === slides.length - infinite || nextIndex === slides.length - slides.length % infinite || nextIndex === 0)) {
325
333
  if (direction) {
326
334
  index = infinite;
327
335
  }
@@ -283,9 +283,17 @@ function lory(slider, opts) {
283
283
 
284
284
  if (typeof nextIndex !== 'number') {
285
285
  if (direction) {
286
- nextIndex = index + slidesToScroll;
286
+ if (infinite && index + infinite * 2 !== slides.length) {
287
+ nextIndex = index + (infinite - index % infinite);
288
+ } else {
289
+ nextIndex = index + slidesToScroll;
290
+ }
287
291
  } else {
288
- nextIndex = index - slidesToScroll;
292
+ if (infinite && index % infinite !== 0) {
293
+ nextIndex = index - index % infinite;
294
+ } else {
295
+ nextIndex = index - slidesToScroll;
296
+ }
289
297
  }
290
298
  }
291
299
 
@@ -321,7 +329,7 @@ function lory(slider, opts) {
321
329
  index = nextIndex;
322
330
  }
323
331
 
324
- if (infinite && (nextIndex === slides.length - infinite || nextIndex === 0)) {
332
+ if (infinite && (nextIndex === slides.length - infinite || nextIndex === slides.length - slides.length % infinite || nextIndex === 0)) {
325
333
  if (direction) {
326
334
  index = infinite;
327
335
  }
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.1.4
4
+ version: 0.2.0
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-04-24 00:00:00.000000000 Z
11
+ date: 2018-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler