Sha256: e2c4792abbd09d86b73d5f4cd23fa8fee2c4124c7cb8526d70de14f835f2d91a

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 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
 */

/*** = Description
  ** Simple checkbox component, toggles the value of
  ** itself between true and false.
  ***/
HCheckbox = HButton.extend({
  componentName: 'checkbox',
  
  defaultEvents: {
    click: true
  },
  
/** Toggles the value checked / unchecked.
  **/
  click: function(){
    this.setValue(!this.value);
  },
/** SetStyle function for HCheckBox
  **/
  setStyle: function(_name,_value,_bypass){
    this.setStyleOfPart('label',_name,_value,_bypass);
  },
  
/**Toggles the checked/unchecked css-class status 
  according to the trueness of the value.**/
  refreshValue: function(){
    if(this.markupElemIds.control){
      if(this.value){
        this.toggleCSSClass(this.markupElemIds.control, 'checked', true);
        this.toggleCSSClass(this.markupElemIds.control, 'unchecked', false);
      }
      else{
        this.toggleCSSClass(this.markupElemIds.control, 'checked', false);
        this.toggleCSSClass(this.markupElemIds.control, 'unchecked', true);
      }
    }
  }
});
//-- Alias for some users:++
HCheckBox = HCheckbox;

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rsence-2.0.0.10.pre js/controls/checkbox/checkbox.js
rsence-2.0.0.9.pre js/controls/checkbox/checkbox.js
rsence-2.0.0.8.pre js/controls/checkbox/checkbox.js
rsence-2.0.0.7.pre js/controls/checkbox/checkbox.js
rsence-2.0.0.6.pre js/controls/checkbox/checkbox.js