Skip to content

Instantly share code, notes, and snippets.

@iurevych
Created August 15, 2014 13:34
Show Gist options
  • Save iurevych/2b67906a31a47e080459 to your computer and use it in GitHub Desktop.
Save iurevych/2b67906a31a47e080459 to your computer and use it in GitHub Desktop.
@UISpoilerToggle = React.createClass
render: ->
<h4 className='ivars-title mbs'>
<a className='js-toggler' href='#'>
{@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 text="#{@props.text or ''}" />
<div className="ivars-list #{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