Skip to content

Commit

Permalink
7.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
idiotWu committed Aug 30, 2017
1 parent f8ba429 commit 113ead2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [7.4.1](https://github.com/idiotWu/smooth-scrollbar/compare/v7.4.0...v7.4.1) (2017-08-31)

### Bug Fixes

- **scrollTo**: fix scrolling curve while `duration=0`. [#94](https://github.com/idiotWu/smooth-scrollbar/issues/94)

## [7.4.0](https://github.com/idiotWu/smooth-scrollbar/compare/v7.3.1...v7.4.0) (2017-08-24)

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smooth-scrollbar",
"version": "7.4.0",
"version": "7.4.1",
"authors": [
"Dolphin Wood <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/smooth-scrollbar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
exports.default = _smoothScrollbar.SmoothScrollbar;


_smoothScrollbar.SmoothScrollbar.version = "7.4.0";
_smoothScrollbar.SmoothScrollbar.version = "7.4.1";

/**
* init scrollbar on given element
Expand Down
24 changes: 13 additions & 11 deletions lib/utils/build-curve.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
/**
* @module
Expand All @@ -18,19 +18,21 @@ Object.defineProperty(exports, "__esModule", {
* @return {Array}: points
*/
var buildCurve = exports.buildCurve = function buildCurve(distance, duration) {
var res = [];
if (duration <= 0) {
return [distance];
}

if (duration <= 0) return res;
var res = [];

var n = Math.round(duration / 1000 * 60) - 1;
var d = distance ? Math.pow(1 / Math.abs(distance), 1 / n) : 0;
var n = Math.round(duration / 1000 * 60) - 1;
var d = distance ? Math.pow(1 / Math.abs(distance), 1 / n) : 0;

for (var i = 1; i <= n; i++) {
res.push(distance - distance * Math.pow(d, i));
}
for (var i = 1; i <= n; i++) {
res.push(distance - distance * Math.pow(d, i));
}

// last frame
res.push(distance);
// last frame
res.push(distance);

return res;
return res;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smooth-scrollbar",
"version": "7.4.0",
"version": "7.4.1",
"description": "Customize scrollbar in modern browsers with smooth scrolling experience.",
"main": "dist/smooth-scrollbar.js",
"style": "dist/smooth-scrollbar.css",
Expand Down

0 comments on commit 113ead2

Please sign in to comment.