Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Progressbar: Take min into account when calculating percentage.

  • Loading branch information...
commit b44375aef19f54e1b4ef5caee6c748b6d9058814 1 parent 20a29df
@kborchers kborchers authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  ui/jquery.ui.progressbar.js
View
2  ui/jquery.ui.progressbar.js
@@ -102,7 +102,7 @@ $.widget( "ui.progressbar", {
},
_percentage: function() {
- return this.indeterminate ? 100 : 100 * this.options.value / this.options.max;
+ return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
@dmethvin Owner
dmethvin added a note

If .setOption() clamps .max to .min this will end up in a divide by zero and the sanity check there will be in vain.

@scottgonzalez Owner

Well, you've also got a useless progressbar at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
},
_refreshValue: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.