skrollr-rails 0.6.13 → 0.6.14

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: 3f74f6fbadf8a2c8c6472aa99d0b34dbb1b54603
4
- data.tar.gz: bbfe9617ee28c2de950fc818694a77fbf8a65a4b
3
+ metadata.gz: b3c41d26cb578a74c6406c0ac39ad512e4ceb579
4
+ data.tar.gz: 0ec5f20f4b4ee77a879d5a76cf39931b198da260
5
5
  SHA512:
6
- metadata.gz: a67c6e9f466c1ea939cf5311ae6d9829a55d976c304313338e41c1b148bf3d56a352a52246ecb5faf58aed8d9380aff92c8e1a1dfbb7e84a8bd5308fcc456b86
7
- data.tar.gz: 9f0879543a7b8d36a83c207a7762cfa10ca25634175ad8b156b515f7dab747d6ef4ab53e40acf3258338f319d9c9f23e8f1666af60372d3348fcd94e58674ab2
6
+ metadata.gz: 9c35869f0600a4dcdff752302721526c47b23b016dcf831408cd4b762e22089edaf7e56406387c26eb24233826dba27bf75c7df394b1d6fbf5a7e87a05a767d8
7
+ data.tar.gz: c65f1da2156b59aa77fa6f278fd0c595ff4c3e60481c6e766a2b66f5059edbe9b446f1d518914d98ff47326226629eaffccfd094adccc5bf889590da426ee0e3
@@ -1,5 +1,5 @@
1
1
  module Skrollr
2
2
  module Rails
3
- VERSION = "0.6.13"
3
+ VERSION = "0.6.14"
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@
19
19
  init: function(options) {
20
20
  return _instance || new Skrollr(options);
21
21
  },
22
- VERSION: '0.6.13'
22
+ VERSION: '0.6.14'
23
23
  };
24
24
 
25
25
  //Minify optimization.
@@ -581,11 +581,7 @@
581
581
  };
582
582
 
583
583
  Skrollr.prototype.setScrollTop = function(top, force) {
584
- //Don't do smooth scrolling (last top === new top).
585
- if(force === true) {
586
- _lastTop = top;
587
- _forceRender = true;
588
- }
584
+ _forceRender = (force === true);
589
585
 
590
586
  if(_isMobile) {
591
587
  _mobileOffset = Math.min(Math.max(top, 0), _maxKeyFrame);
@@ -756,7 +752,7 @@
756
752
 
757
753
  duration = duration * (1 - targetRatio);
758
754
 
759
- _instance.animateTo(targetTop, {easing: 'outCubic', duration: duration});
755
+ _instance.animateTo((targetTop + 0.5) | 0, {easing: 'outCubic', duration: duration});
760
756
  break;
761
757
  }
762
758
  });
@@ -982,8 +978,8 @@
982
978
 
983
979
  _instance.setScrollTop(renderTop, true);
984
980
  }
985
- //Smooth scrolling only if there's no animation running and if we're not on mobile.
986
- else if(!_isMobile) {
981
+ //Smooth scrolling only if there's no animation running and if we're not forcing the rendering.
982
+ else if(!_forceRender) {
987
983
  var smoothScrollingDiff = _smoothScrolling.targetTop - renderTop;
988
984
 
989
985
  //The user scrolled, start new smooth scrolling.
@@ -1015,7 +1011,7 @@
1015
1011
  //Did the scroll position even change?
1016
1012
  if(_forceRender || _lastTop !== renderTop) {
1017
1013
  //Remember in which direction are we scrolling?
1018
- _direction = (renderTop >= _lastTop) ? 'down' : 'up';
1014
+ _direction = (renderTop > _lastTop) ? 'down' : (renderTop < _lastTop ? 'up' : _direction);
1019
1015
 
1020
1016
  _forceRender = false;
1021
1017
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skrollr-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.13
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Reed