Created
August 15, 2014 13:34
-
-
Save iurevych/2b67906a31a47e080459 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='#'> | |
{@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