Skip to content

Commit

Permalink
Release 0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmobrunfeldt committed Jan 13, 2015
1 parent b2d0b89 commit 21a40a7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ProgressBar.js

**Version: 0.7.3** ([*previous stable*](https://github.com/kimmobrunfeldt/progressbar.js/tree/0.7.2), [*latest dev*](https://github.com/kimmobrunfeldt/progressbar.js/tree/dev))
**Version: 0.7.4** ([*previous stable*](https://github.com/kimmobrunfeldt/progressbar.js/tree/0.7.3), [*latest dev*](https://github.com/kimmobrunfeldt/progressbar.js/tree/dev))

<br>
![Beautiful animation](docs/animation.gif)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "progressbar.js",
"main": "dist/progressbar.js",
"version": "0.7.3-dev",
"version": "0.7.4",
"homepage": "https://github.com/kimmobrunfeldt/progressbar.js",
"authors": [
"Kimmo Brunfeldt <[email protected]>"
Expand Down
15 changes: 10 additions & 5 deletions dist/progressbar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ProgressBar.js 0.7.3
// ProgressBar.js 0.7.4
// https://kimmobrunfeldt.github.io/progressbar.js
// License: MIT

Expand Down Expand Up @@ -1520,7 +1520,8 @@ Path.prototype.set = function set(progress) {

var step = this._opts.step;
if (utils.isFunction(step)) {
var values = this._calculateTo(progress, this._opts.easing);
var easing = this._easing(this._opts.easing);
var values = this._calculateTo(progress, easing);
step(values, this._opts.attachment || this);
}
};
Expand Down Expand Up @@ -1710,6 +1711,9 @@ Shape.prototype.animate = function animate(progress, opts, cb) {

Shape.prototype.stop = function stop() {
if (this._progressPath === null) throw new Error(DESTROYED_ERROR);
// Don't crash if stop is called inside step function
if (this._progressPath === undefined) return;

this._progressPath.stop();
};

Expand All @@ -1736,6 +1740,8 @@ Shape.prototype.set = function set(progress) {

Shape.prototype.value = function value() {
if (this._progressPath === null) throw new Error(DESTROYED_ERROR);
if (this._progressPath === undefined) return 0;

return this._progressPath.value();
};

Expand All @@ -1746,11 +1752,10 @@ Shape.prototype.setText = function setText(text) {
// Create new text node
this.text = this._createTextElement(this._opts, this._container);
this._container.appendChild(this.text);
} else {
// Remove previous text node
this.text.removeChild(this.text.firstChild);
}

// Remove previous text node and add new
this.text.removeChild(this.text.firstChild);
this.text.appendChild(document.createTextNode(text));
};

Expand Down
Loading

0 comments on commit 21a40a7

Please sign in to comment.