Permalink
Browse files

Progressbar: Prevent firing change event on create for both determina…

…te and indeterminate
  • Loading branch information...
1 parent 522338f commit abb4eb5020e6b0a8fb9feb594c2c31f309b1a3b1 @kborchers committed Mar 29, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.progressbar.js
@@ -35,6 +35,7 @@ $.widget( "ui.progressbar", {
this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
.appendTo( this.element );
+ this.oldValue = this._value();
this._refreshValue();
},
@@ -61,7 +62,6 @@ $.widget( "ui.progressbar", {
_setOption: function( key, value ) {
if ( key === "value" ) {
this.options.value = value;
-
this._refreshValue();
if ( this._value() === this.options.max ) {
this._trigger( "complete" );
@@ -93,7 +93,7 @@ $.widget( "ui.progressbar", {
this.valueDiv.toggleClass( "ui-progressbar-indeterminate", isNaN( value ) );
- if ( this.oldValue !== value ) {
+ if ( this.oldValue !== value && ( !isNaN( this.oldValue ) || !isNaN( value ) ) ) {
this.oldValue = value;
this._trigger( "change" );
}

0 comments on commit abb4eb5

Please sign in to comment.