Skip to content

Commit

Permalink
[feat] Refresh with min value support (back compatible fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Aug 6, 2019
1 parent f6930ac commit b51840c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ pointerOptions: {
Used to refresh Gauge value and max value
`refresh(val, max)`
`refresh(val, max, min)`
- `val` : The Gauge value (required)
- `max` : The Gauge Max value (optional)
- `min` : The Gauge Min value (optional)
### Destroy
Expand Down
6 changes: 3 additions & 3 deletions examples/refresh-minimum-maximum.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@
});

document.getElementById('g1_setmax100').addEventListener('click', function() {
g1.refresh(g1.originalValue, 20, 100);
g1.refresh(g1.originalValue, 100, 20);
return false;
});

document.getElementById('g1_setmax200').addEventListener('click', function() {
g1.refresh(g1.originalValue, 30, 200);
g1.refresh(g1.originalValue, 200, 30);
return false;
});

document.getElementById('g1_setmax400').addEventListener('click', function() {
g1.refresh(g1.originalValue, 5, 400);
g1.refresh(g1.originalValue, 400, 5);
return false;
});

Expand Down
2 changes: 1 addition & 1 deletion justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ JustGage = function(config) {
};

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

var obj = this;
var displayVal, color, max = max || null, min = min || null;
Expand Down

0 comments on commit b51840c

Please sign in to comment.