Created
June 11, 2014 22:27
-
-
Save gjbagrowski/417f005c6c619cffc45b 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
ActionBar = React.createClass | |
mixins: [ | |
React.BackboneMixin("actions") | |
] | |
render: -> | |
<ul className="nav navbar-nav"> | |
<li className="dropdown"> | |
<a className="dropdown-toggle" data-toggle="dropdown" href='#'> | |
<span>Action</span> | |
<b className="caret" /> | |
</a> | |
<ul className="dropdown-menu" role="menu"> | |
{@props.actions.map (action) => | |
<li key={action.id}> | |
<a href='#' onClick={@handleActionClick.bind(this, action.id)}> | |
{action.get('name')} | |
</a> | |
</li> | |
} | |
</ul> | |
</li> | |
</ul> | |
handleActionClick: (actionId) -> | |
# launch command handler registered for selected action | |
Backbone.Radio.Commands.command(actionId) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment