Sha256: 3f77872e152192ea7a897affa47727ce888bd064eaa7aa9640d7645e77e4a37c

Contents?: true

Size: 1.48 KB

Versions: 105

Compression:

Stored size: 1.48 KB

Contents

/*   RSence
 *   Copyright 2008 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
 */

var//RSence.Controls
HValidatorView = HControl.extend({

  controlDefaults: (HControlDefaults.extend({
    value: false,
    valueField: false
  })),

  setRect: function(_rect) {
    var _options = this.options;
    if(_options){
      if(_options.valueField){
        _rect.offsetTo(
          _options.valueField.rect.right,
          _options.valueField.rect.top
        );
      }
    }
    this.base(_rect);
  },
  
/** = Description
  * Ensures the value set is a Boolean.
  *
  * = Parameters
  * +_flag+::   True to set the status to selected, false to set to unselected.
  *
  **/
  setValue: function(_flag) {
    if (!_flag && _flag !== false) {
      _flag = false;
    }
    this.base(_flag);
  },

/** = Description
  * Updates the graphics to match the Boolean value.
  *
  **/
  refreshValue: function(){
    var _this = this,
        _value = _this.value,
        _trueValue = _value === true,
        _x = _trueValue?-21:0,
        _y = _this.enabled?0:-21,
        _title = _trueValue?'':_value,
        _elemId = _this.elemId;
    ELEM.setStyle(_elemId,'background-image',"url("+_this.getThemeGfxFile('validator.png')+")");
    ELEM.setStyle(_elemId,'background-repeat','no-repeat');
    ELEM.setStyle(_elemId,'background-position',_x+'px '+_y+'px');
  }

  
});

Version data entries

105 entries across 105 versions & 2 rubygems

Version Path
rsence-pre-2.3.0.15 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.14 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.13 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.12 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.11 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.10 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.9 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.8 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.7 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.6 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.5 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.4 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.3 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.2 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.1 js/controls/validatorview/validatorview.js
rsence-pre-2.3.0.0 js/controls/validatorview/validatorview.js
rsence-2.2.5 js/controls/validatorview/validatorview.js
rsence-2.2.4 js/controls/validatorview/validatorview.js
rsence-2.2.3 js/controls/validatorview/validatorview.js
rsence-2.2.2 js/controls/validatorview/validatorview.js