Sha256: 93c7dc4b4fee35e5cd0dc66ab211828cd6e542a727a396036fc9d0b7eeae12d6
Contents?: true
Size: 1.52 KB
Versions: 5
Compression:
Stored size: 1.52 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 button component, designed to be extended for any ** actual functionality above regular HControl. ** It's limited to 24px height by the default theme, because ** it's much simpler to render that way. ***/ HButton = HControl.extend({ componentName: 'button', /** = Description * setStyle function for button. * **/ setStyle: function(_name, _value){ ELEM.setStyle(this.markupElemIds.label,_name,_value); return this; } }); /*** = Description ** Simple HButton extension, operates on its value so it's useful ** for sending button clicks to the server and the like. ** For the value responder, reset the value to 0 when read to make ** the button clickable again. ** ** = Value states ** +0+:: Enabled, clickable ** +1+:: Disabled, clicked ** +Other+:: Disabled, not clickable, not clicked ***/ HClickButton = HButton.extend({ defaultEvents: { click: true }, /** = Description * Sets the button enabled if this.value is 0. * **/ refreshValue: function(){ this.setEnabled( this.value === 0 ); }, /** = Description * Click method, sets the value to disabled if the button is enabled. * **/ click: function(){ if(this.enabled){ this.setValue(1); } } }); HClickValueButton = HClickButton;
Version data entries
5 entries across 5 versions & 1 rubygems