Skip to content

Instantly share code, notes, and snippets.

@iurevych
Created August 15, 2014 13:22
Show Gist options
  • Save iurevych/62617714968694a94b63 to your computer and use it in GitHub Desktop.
Save iurevych/62617714968694a94b63 to your computer and use it in GitHub Desktop.
@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