Skip to content

Commit

Permalink
Minor fixes - v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kottenator committed Oct 30, 2014
1 parent 3d951a1 commit eef429e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,17 @@ $('#circle').circleProgress({ value: 0.5 });
var canvas = $('#circle').circleProgress('widget');
```

You can get the `CircleProgress` instance:
```js
var instance = $('#circle').data('circle-progress');
```

You can redraw existing circle *(but only if the widget is already inited)*:
```js
$('#circle').circleProgress({ value: 0.5, fill: { color: 'orange' }});
$('#circle').circleProgress('redraw'); // will use current configuration and redraw the circle
$('#circle').circleProgress('redraw'); // use current configuration and redraw
$('#circle').circleProgress(); // alias for 'redraw'
$('#circle').circleProgress({ size: 150 }); // set new size and redraw
```

You can change the default options:
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": "jquery-circle-progress",
"version": "1.1.0",
"version": "1.1.1",
"authors": [
"Rostyslav Bryzgunov <[email protected]>"
],
Expand Down
36 changes: 20 additions & 16 deletions dist/circle-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jquery-circle-progress - jQuery Plugin to draw animated circular progress bars
URL: http://kottenator.github.io/jquery-circle-progress/
Author: Rostyslav Bryzgunov <[email protected]>
Version: 1.1.0
Version: 1.1.1
License: MIT
*/
(function($) {
Expand Down Expand Up @@ -82,51 +82,56 @@ License: MIT
*/
reverse: false,

//--------------------------------------- private properties and methods ---------------------------------------
//-------------------------------------- protected properties and methods --------------------------------------
/**
* @protected
*/
constructor: CircleProgress,

/**
* Container element. Should be passed into constructor config
* @private
* @protected
* @type {jQuery}
*/
el: null,

/**
* Canvas element. Automatically generated and prepended to the {@link CircleProgress.el container}
* @private
* @protected
* @type {HTMLCanvasElement}
*/
canvas: null,

/**
* 2D-context of the {@link CircleProgress.canvas canvas}
* @private
* @protected
* @type {CanvasRenderingContext2D}
*/
ctx: null,

/**
* Radius of the outer circle. Automatically calculated as {@link CircleProgress.size} / 2
* @private
* @protected
* @type {number}
*/
radius: 0.0,

/**
* Fill of the main arc. Automatically calculated, depending on {@link CircleProgress.fill} option
* @private
* @protected
* @type {string|CanvasGradient|CanvasPattern}
*/
arcFill: null,

/**
* Last rendered frame value
* @private
* @protected
* @type {number}
*/
lastFrameValue: 0.0,

/**
* @private
* Init/re-init the widget
* @param {object} config Config
*/
init: function(config) {
Expand All @@ -138,7 +143,7 @@ License: MIT
},

/**
* @private
* @protected
*/
initWidget: function() {
var canvas = this.canvas = this.canvas || $('<canvas>').prependTo(this.el)[0];
Expand All @@ -150,7 +155,7 @@ License: MIT
/**
* This method sets {@link CircleProgress.arcFill}
* It could do this async (on image load)
* @private
* @protected
*/
initFill: function() {
var self = this,
Expand Down Expand Up @@ -210,7 +215,7 @@ License: MIT
},

/**
* @private
* @protected
* @param {number} v Frame value
*/
drawFrame: function(v) {
Expand All @@ -221,7 +226,7 @@ License: MIT
},

/**
* @private
* @protected
* @param {number} v Frame value
*/
drawArc: function(v) {
Expand All @@ -246,7 +251,7 @@ License: MIT
},

/**
* @private
* @protected
* @param {number} v Frame value
*/
drawEmptyArc: function(v) {
Expand Down Expand Up @@ -277,7 +282,7 @@ License: MIT
},

/**
* @private
* @protected
* @param {number} v Value
*/
drawAnimated: function(v) {
Expand Down Expand Up @@ -356,7 +361,6 @@ License: MIT

if (instance) {
instance.init(cfg);
instance.draw();
} else {
cfg.el = el;
instance = new CircleProgress(cfg);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-circle-progress",
"version": "1.1.0",
"version": "1.1.1",
"author": "Rostyslav Bryzgunov <[email protected]>",
"description": "Plugin to draw animated circular progress bars",
"license": "MIT",
Expand Down

0 comments on commit eef429e

Please sign in to comment.