From 41aea41aaff0886fd6c211f03db2b54863a97165 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Thu, 21 Jan 2016 13:48:06 +0100 Subject: filters are working ! --- src/web/js/components/MiddlePanel.react.js | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'src/web/js/components/MiddlePanel.react.js') diff --git a/src/web/js/components/MiddlePanel.react.js b/src/web/js/components/MiddlePanel.react.js index 51d582c0..c5a9c3f9 100644 --- a/src/web/js/components/MiddlePanel.react.js +++ b/src/web/js/components/MiddlePanel.react.js @@ -50,10 +50,8 @@ var TableLine = React.createClass({ }); var TableBody = React.createClass({ - propTypes: {articles: React.PropTypes.array.isRequired, - }, getInitialState: function() { - return {articles: this.props.articles, + return {articles: [], }; }, render: function() { @@ -73,19 +71,6 @@ var TableBody = React.createClass({ ); - } -}); - -var MiddlePanel = React.createClass({ - getInitialState: function() { - return {articles: []}; - }, - render: function() { - var body = null; - if(this.state.articles.length) { - body = (); - } - return (
{body}
); }, componentDidMount: function() { MiddlePanelActions.reload(); @@ -95,8 +80,16 @@ var MiddlePanel = React.createClass({ MiddlePanelStore.removeChangeListener(this._onChange); }, _onChange: function() { - var datas = MiddlePanelStore.getAll(); - this.setState({articles: datas.articles}); + this.setState({articles: MiddlePanelStore.getArticles()}); + }, +}); + +var MiddlePanel = React.createClass({ + render: function() { + return (
+ +
+ ); }, }); -- cgit