-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #24
- Loading branch information
Showing
9 changed files
with
101 additions
and
56 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** @jsx React.DOM */ | ||
|
||
var React = require('react'); | ||
var _ = require('lodash'); | ||
|
||
var AppActions = require('../actions/app-actions'); | ||
var AppStore = require('../stores/app-store'); | ||
|
||
var GROUPINGS = [{ | ||
id: 'none', | ||
iconClass: 'fa fa-th' | ||
}, { | ||
id: 'grouped', | ||
iconClass: 'fa fa-th-large' | ||
}]; | ||
|
||
var Groupings = React.createClass({ | ||
|
||
onGroupingClick: function(ev) { | ||
ev.preventDefault(); | ||
AppActions.clickGrouping(ev.currentTarget.getAttribute('rel')); | ||
}, | ||
|
||
renderGrouping: function(grouping, active) { | ||
var className = grouping.id === active ? "groupings-item groupings-item-active" : "groupings-item"; | ||
|
||
return ( | ||
<div className={className} key={grouping.id} rel={grouping.id} onClick={this.onGroupingClick}> | ||
<span className={grouping.iconClass} /> | ||
</div> | ||
); | ||
}, | ||
|
||
render: function() { | ||
var activeGrouping = this.props.active; | ||
|
||
return ( | ||
<div className="groupings"> | ||
{GROUPINGS.map(function(grouping) { | ||
return this.renderGrouping(grouping, activeGrouping); | ||
}, this)} | ||
</div> | ||
); | ||
} | ||
|
||
}); | ||
|
||
module.exports = Groupings; |
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
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
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
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
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