diff --git a/themes/base/images/ui-bg_diagonals-thick_20_666666_40x40.png b/themes/base/images/ui-bg_diagonals-thick_20_666666_40x40.png new file mode 100755 index 00000000000..64ece5707d9 Binary files /dev/null and b/themes/base/images/ui-bg_diagonals-thick_20_666666_40x40.png differ diff --git a/themes/base/jquery.ui.progressbar.css b/themes/base/jquery.ui.progressbar.css index e24afc88681..effcfeb9d3f 100644 --- a/themes/base/jquery.ui.progressbar.css +++ b/themes/base/jquery.ui.progressbar.css @@ -8,4 +8,28 @@ * http://docs.jquery.com/UI/Progressbar#theming */ .ui-progressbar { height:2em; text-align: left; overflow: hidden; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file +.ui-progressbar .ui-progressbar-value { margin: -1px; height:100%; } +@-webkit-keyframes bg-anim { + from { background-position: 0 0 } + to { background-position: 40px 0 } +} +@-moz-keyframes bg-anim { + from { background-position: 0 0 } + to { background-position: 40px 0 } +} +@-ms-keyframes bg-anim { + from { background-position: 0 0 } + to { background-position: 40px 0 } +} +@keyframes bg-anim { + from { background-position: 0 0 } + to { background-position: 40px 0 } +} + +.ui-progressbar .ui-progressbar-indeterminate { + background: url("images/ui-bg_diagonals-thick_20_666666_40x40.png"); + -webkit-animation: bg-anim 1s linear infinite; + -moz-animation: bg-anim 1s linear infinite; + -ms-animation: bg-anim 1s linear infinite; + animation: bg-anim 1s linear infinite; +} diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js index 26f5e76f0e8..b268497bd1f 100644 --- a/ui/jquery.ui.progressbar.js +++ b/ui/jquery.ui.progressbar.js @@ -23,13 +23,13 @@ $.widget( "ui.progressbar", { min: 0, _create: function() { + var val = this._value(); this.element .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) .attr({ role: "progressbar", "aria-valuemin": this.min, - "aria-valuemax": this.options.max, - "aria-valuenow": this._value() + "aria-valuemax": this.options.max }); this.valueDiv = $( "
" ) @@ -74,30 +74,39 @@ $.widget( "ui.progressbar", { _value: function() { var val = this.options.value; // normalize invalid value - if ( typeof val !== "number" ) { + if ( typeof val !== "number" && val !== false ) { val = 0; + } else if( val === false ) { + val = NaN; } return Math.min( this.options.max, Math.max( this.min, val ) ); }, _percentage: function() { - return 100 * this._value() / this.options.max; + var val = this._value(); + return isNaN( val ) ? 100 : 100 * val / this.options.max; }, _refreshValue: function() { var value = this.value(); var percentage = this._percentage(); - if ( this.oldValue !== value ) { + this.valueDiv.toggleClass( "ui-progressbar-indeterminate", isNaN( value ) ); + + if ( this.oldValue !== value && ( !isNaN( this.oldValue ) || !isNaN( value ) ) ) { this.oldValue = value; this._trigger( "change" ); } this.valueDiv - .toggle( value > this.min ) + .toggle( isNaN( value ) || value > this.min ) .toggleClass( "ui-corner-right", value === this.options.max ) .width( percentage.toFixed(0) + "%" ); - this.element.attr( "aria-valuenow", value ); + if ( isNaN( value ) ) { + this.element.removeAttr( "aria-valuenow" ); + } else { + this.element.attr( "aria-valuenow", value ); + } } });