Created
August 15, 2014 13:22
-
-
Save iurevych/62617714968694a94b63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@UISpoilerToggle = React.createClass | |
render: -> | |
<h4 className='ivars-title mbs'> | |
<a className='js-toggler' href='#' data-selector="#{@props.name or ''}"> | |
{@props.text} | |
</a> | |
</h4> | |
@UISpoiler = React.createClass | |
getInitialState: -> | |
hidden: true | |
, | |
handleClick: (e) -> | |
if $(e.target).hasClass 'js-toggler' | |
@setState | |
hidden: [email protected] | |
, | |
render: -> | |
<div onClick={@handleClick}> | |
<UISpoilerToggle name="#{@props.name or ''}" text="#{@props.text or ''}" /> | |
<div className="ivars-list #{@props.name or ''} #{if @state.hidden then 'hidden' else ''}"> | |
<p className='mbl'>GET DATA WITH $.GET</p> | |
</div> | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment