by category page

This commit is contained in:
Edin Dazdarevic
2015-02-04 06:51:49 +01:00
parent 67e31fe716
commit 6fc5969fe6
7 changed files with 105 additions and 11 deletions

View File

@@ -37,8 +37,11 @@ var BySection = React.createClass({
return (
<div style={s}>
<a onClick={self.onCategoryClick.bind(self, category, self.state.section)}>
<img src={category.image_url || 'http://www.windeln.de/resources/img/content/kat_windelnwickeln.jpg'}/>
<div onClick={self.onCategoryClick.bind(self, category, self.state.section)}> {category.name}</div>
<div>{category.name}</div>
</a>
<ul>
{category.sub_categories.map(function(sc) {
return (<li>{sc.name}</li>)
@@ -71,6 +74,10 @@ var BySection = React.createClass({
SectionStore.addChangeListener(this._onSectionChange);
ItemStore.addChangeListener(this._onChange);
},
componentWillUnmount: function() {
SectionStore.removeChangeListener(this._onSectionChange);
ItemStore.removeChangeListener(this._onChange);
},
_onSectionChange: function() {
if(this.isMounted()) {
this.setState({