by category page
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user