Permalink
Browse files

Progressbar: Take min into account when calculating percentage.

  • Loading branch information...
1 parent 20a29df commit b44375aef19f54e1b4ef5caee6c748b6d9058814 @kborchers kborchers committed Dec 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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
dmethvin Dec 6, 2012 Member

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
scottgonzalez Dec 6, 2012 Member

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

},
_refreshValue: function() {

0 comments on commit b44375a

Please sign in to comment.