Skip to content

Commit a007db8

Browse files
Release 1.0.1
1 parent dd70429 commit a007db8

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

dist/progressbar.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// ProgressBar.js 1.0.0
1+
// ProgressBar.js 1.0.1
22
// https://kimmobrunfeldt.github.io/progressbar.js
33
// License: MIT
44

5-
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.ProgressBar=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
5+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ProgressBar = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
66
/* shifty - v1.5.2 - 2016-02-10 - http://jeremyckahn.github.io/shifty */
77
;(function () {
88
var root = this || Function('return this')();
@@ -1760,6 +1760,11 @@ var EASING_ALIASES = {
17601760
};
17611761

17621762
var Path = function Path(path, opts) {
1763+
// Throw a better error if not initialized with `new` keyword
1764+
if (!(this instanceof Path)) {
1765+
throw new Error('Constructor was called without new keyword');
1766+
}
1767+
17631768
// Default parameters for animation
17641769
opts = utils.extend({
17651770
duration: 800,
@@ -2013,13 +2018,14 @@ var Shape = function Shape(container, opts) {
20132018
},
20142019
autoStyleContainer: true,
20152020
alignToBottom: true,
2016-
value: '',
2021+
value: null,
20172022
className: 'progressbar-text'
20182023
},
20192024
svgStyle: {
20202025
display: 'block',
20212026
width: '100%'
2022-
}
2027+
},
2028+
warnings: false
20232029
}, opts, true); // Use recursive extend
20242030

20252031
// If user specifies e.g. svgStyle or text style, the whole object
@@ -2046,7 +2052,9 @@ var Shape = function Shape(container, opts) {
20462052

20472053
this._container = element;
20482054
this._container.appendChild(svgView.svg);
2049-
this._warnContainerAspectRatio(this._container);
2055+
if (this._opts.warnings) {
2056+
this._warnContainerAspectRatio(this._container);
2057+
}
20502058

20512059
if (this._opts.svgStyle) {
20522060
utils.setStyles(svgView.svg, this._opts.svgStyle);
@@ -2064,7 +2072,7 @@ var Shape = function Shape(container, opts) {
20642072
}, this._opts);
20652073
this._progressPath = new Path(svgView.path, newOpts);
20662074

2067-
if (utils.isObject(this._opts.text) && this._opts.text.value) {
2075+
if (utils.isObject(this._opts.text) && this._opts.text.value !== null) {
20682076
this.setText(this._opts.text.value);
20692077
}
20702078
};
@@ -2265,7 +2273,7 @@ Shape.prototype._warnContainerAspectRatio = function _warnContainerAspectRatio(c
22652273
if (!utils.floatEquals(this.containerAspectRatio, width / height)) {
22662274
console.warn(
22672275
'Incorrect aspect ratio of container',
2268-
this._container,
2276+
'#' + container.id,
22692277
'detected:',
22702278
computedStyle.getPropertyValue('width') + '(width)',
22712279
'/',

0 commit comments

Comments
 (0)