Sha256: 25bc9388252f47cede21f5fe50c7e52d237286c28a50e3dd449c2806f95279ec

Contents?: true

Size: 1.68 KB

Versions: 16

Compression:

Stored size: 1.68 KB

Contents

/*   RSence
 *   Copyright 2006 Riassence Inc.
 *   http://riassence.com/
 *
 *   You should have received a copy of the GNU General Public License along
 *   with this software package. If not, contact licensing@riassence.com
 */

/*** = Description
  ** A progress indicator is the indeterminate progress bar, which is used in 
  ** situations where the extent of the task is unknown or the progress of 
  ** the task can not be determined in a way that could be expressed as a 
  ** percentage. This bar uses motion or some other indicator to show that 
  ** progress is taking place, rather than using the size of the filled portion
  ** to show the total amount of progress.
  ***/
var//RSence.Controls
HProgressIndicator = HView.extend({
  _indicator: null,
  _animDirection: 0,
  drawSubviews: function(){
    var _this = this;
    _this.setStyle( 'border', '1px solid #999' );
    _this.setStyle( 'background-color', '#ccc' );
    var _height = _this.rect.height,
        _visibleWidth = ELEM.getVisibleSize( _this.elemId )[0],
        _width = (_visibleWidth===0)?_this.rect.width:_visibleWidth;
    _width -= 2;
    _this['_rect'+0] = HRect.nu( 0,0,_height,_height );
    _this['_rect'+1] = HRect.nu( _width-_height, 0, _width, _height );
    _this._indicator = HView.nu( HRect.nu( _this['_rect'+0] ), _this );
    _this._indicator.setStyle('background-color','#333');
    _this._indicator.onAnimationEnd = function(){
      this.parent._toggleDirection();
    };
    _this._toggleDirection();
  },
  _toggleDirection: function(){
    this._animDirection = this._animDirection===1?0:1;
    var _directionRect = HRect.nu( this['_rect'+this._animDirection] );
    this._indicator.animateTo(_directionRect);
  }
});

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
rsence-pre-2.1.0.7.pre js/controls/progress/progressindicator/progressindicator.js
rsence-pre-2.1.0.6.pre js/controls/progress/progressindicator/progressindicator.js
rsence-pre-2.1.0.4.pre js/controls/progress/progressindicator/progressindicator.js
rsence-pre-2.1.0.3.pre js/controls/progress/progressindicator/progressindicator.js
rsence-pre-2.1.0.2.pre js/controls/progress/progressindicator/progressindicator.js
rsence-pre-2.1.0.1.pre js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.9.23 js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.9.22.pre js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.9.21.pre js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.9.20.pre js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.8.19 js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.4.15 js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.3.14 js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.2.13 js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.1.12 js/controls/progress/progressindicator/progressindicator.js
rsence-2.0.0.11 js/controls/progress/progressindicator/progressindicator.js