Skip to content

Commit eef429e

Browse files
committed
Minor fixes - v1.1.1
1 parent 3d951a1 commit eef429e

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,17 @@ $('#circle').circleProgress({ value: 0.5 });
7474
var canvas = $('#circle').circleProgress('widget');
7575
```
7676

77+
You can get the `CircleProgress` instance:
78+
```js
79+
var instance = $('#circle').data('circle-progress');
80+
```
81+
7782
You can redraw existing circle *(but only if the widget is already inited)*:
7883
```js
7984
$('#circle').circleProgress({ value: 0.5, fill: { color: 'orange' }});
80-
$('#circle').circleProgress('redraw'); // will use current configuration and redraw the circle
85+
$('#circle').circleProgress('redraw'); // use current configuration and redraw
8186
$('#circle').circleProgress(); // alias for 'redraw'
87+
$('#circle').circleProgress({ size: 150 }); // set new size and redraw
8288
```
8389

8490
You can change the default options:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-circle-progress",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"authors": [
55
"Rostyslav Bryzgunov <kottenator@gmail.com>"
66
],

dist/circle-progress.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jquery-circle-progress - jQuery Plugin to draw animated circular progress bars
33
44
URL: http://kottenator.github.io/jquery-circle-progress/
55
Author: Rostyslav Bryzgunov <kottenator@gmail.com>
6-
Version: 1.1.0
6+
Version: 1.1.1
77
License: MIT
88
*/
99
(function($) {
@@ -82,51 +82,56 @@ License: MIT
8282
*/
8383
reverse: false,
8484

85-
//--------------------------------------- private properties and methods ---------------------------------------
85+
//-------------------------------------- protected properties and methods --------------------------------------
86+
/**
87+
* @protected
88+
*/
89+
constructor: CircleProgress,
90+
8691
/**
8792
* Container element. Should be passed into constructor config
88-
* @private
93+
* @protected
8994
* @type {jQuery}
9095
*/
9196
el: null,
9297

9398
/**
9499
* Canvas element. Automatically generated and prepended to the {@link CircleProgress.el container}
95-
* @private
100+
* @protected
96101
* @type {HTMLCanvasElement}
97102
*/
98103
canvas: null,
99104

100105
/**
101106
* 2D-context of the {@link CircleProgress.canvas canvas}
102-
* @private
107+
* @protected
103108
* @type {CanvasRenderingContext2D}
104109
*/
105110
ctx: null,
106111

107112
/**
108113
* Radius of the outer circle. Automatically calculated as {@link CircleProgress.size} / 2
109-
* @private
114+
* @protected
110115
* @type {number}
111116
*/
112117
radius: 0.0,
113118

114119
/**
115120
* Fill of the main arc. Automatically calculated, depending on {@link CircleProgress.fill} option
116-
* @private
121+
* @protected
117122
* @type {string|CanvasGradient|CanvasPattern}
118123
*/
119124
arcFill: null,
120125

121126
/**
122127
* Last rendered frame value
123-
* @private
128+
* @protected
124129
* @type {number}
125130
*/
126131
lastFrameValue: 0.0,
127132

128133
/**
129-
* @private
134+
* Init/re-init the widget
130135
* @param {object} config Config
131136
*/
132137
init: function(config) {
@@ -138,7 +143,7 @@ License: MIT
138143
},
139144

140145
/**
141-
* @private
146+
* @protected
142147
*/
143148
initWidget: function() {
144149
var canvas = this.canvas = this.canvas || $('<canvas>').prependTo(this.el)[0];
@@ -150,7 +155,7 @@ License: MIT
150155
/**
151156
* This method sets {@link CircleProgress.arcFill}
152157
* It could do this async (on image load)
153-
* @private
158+
* @protected
154159
*/
155160
initFill: function() {
156161
var self = this,
@@ -210,7 +215,7 @@ License: MIT
210215
},
211216

212217
/**
213-
* @private
218+
* @protected
214219
* @param {number} v Frame value
215220
*/
216221
drawFrame: function(v) {
@@ -221,7 +226,7 @@ License: MIT
221226
},
222227

223228
/**
224-
* @private
229+
* @protected
225230
* @param {number} v Frame value
226231
*/
227232
drawArc: function(v) {
@@ -246,7 +251,7 @@ License: MIT
246251
},
247252

248253
/**
249-
* @private
254+
* @protected
250255
* @param {number} v Frame value
251256
*/
252257
drawEmptyArc: function(v) {
@@ -277,7 +282,7 @@ License: MIT
277282
},
278283

279284
/**
280-
* @private
285+
* @protected
281286
* @param {number} v Value
282287
*/
283288
drawAnimated: function(v) {
@@ -356,7 +361,6 @@ License: MIT
356361

357362
if (instance) {
358363
instance.init(cfg);
359-
instance.draw();
360364
} else {
361365
cfg.el = el;
362366
instance = new CircleProgress(cfg);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-circle-progress",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"author": "Rostyslav Bryzgunov <kottenator@gmail.com>",
55
"description": "Plugin to draw animated circular progress bars",
66
"license": "MIT",

0 commit comments

Comments
 (0)