Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
toorshia committed Apr 6, 2016
2 parents 7f6b250 + b0fc8e4 commit 68824f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ JustGage is a handy JavaScript plugin for generating and animating nice & cl

###Update log

######March 29, 2016.
* **refresh(val, max, config)** - now you can include config object when calling refresh function to update any existing justGage parameter

######March 25, 2016.
* **onAnimationEnd** - callback function after gauge animation ends
- demo at http://justgage.com/examples/animation-events-hooks.html
Expand Down
11 changes: 10 additions & 1 deletion justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,11 +857,20 @@ JustGage = function(config) {
};

/** Refresh gauge level */
JustGage.prototype.refresh = function(val, max) {
JustGage.prototype.refresh = function(val, max, config) {

var obj = this;
var displayVal, color, max = max || null;

if(config && (typeof config === "object")) {
for(var key in config) {
if(!config.hasOwnProperty(key)) {
continue;
}
obj.config[key] = config[key];
}
}

// set new max
if (max !== null) {
obj.config.max = max;
Expand Down

0 comments on commit 68824f6

Please sign in to comment.