aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/stores
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-21 13:48:06 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-26 23:47:08 +0100
commit41aea41aaff0886fd6c211f03db2b54863a97165 (patch)
tree8d67b31febf78b5c40d60dc8ea3cb613fa4a65f2 /src/web/js/stores
parentbootstraping react (diff)
downloadnewspipe-41aea41aaff0886fd6c211f03db2b54863a97165.tar.gz
newspipe-41aea41aaff0886fd6c211f03db2b54863a97165.tar.bz2
newspipe-41aea41aaff0886fd6c211f03db2b54863a97165.zip
filters are working !
Diffstat (limited to 'src/web/js/stores')
-rw-r--r--src/web/js/stores/MiddlePanelStore.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/web/js/stores/MiddlePanelStore.js b/src/web/js/stores/MiddlePanelStore.js
index d5744e20..4e6e04c4 100644
--- a/src/web/js/stores/MiddlePanelStore.js
+++ b/src/web/js/stores/MiddlePanelStore.js
@@ -11,6 +11,21 @@ var MiddlePanelStore = assign({}, EventEmitter.prototype, {
getAll: function() {
return this._datas;
},
+ getArticles: function() {
+ var articles = [];
+ var key = null;
+ var id = null;
+ if (this._datas.parent_filter_type) {
+ key = this._datas.parent_filter_type + '_id';
+ id = this._datas.parent_filter_id;
+ }
+ this._datas.articles.map(function(article) {
+ if(!key || article[key] == id) {
+ articles.push(article);
+ }
+ });
+ return articles;
+ },
setFilter: function(value) {
if(this._datas.filter != value) {
this._datas.filter = value;
@@ -46,7 +61,7 @@ MiddlePanelStore.dispatchToken = JarrDispatcher.register(function(action) {
// PARENT FILTER
case MiddlePanelActionTypes.MIDDLE_PANEL_PARENT_FILTER:
MiddlePanelStore.setParentFilter(action.parent_type,
- action.filter_id);
+ action.parent_id);
break;
// FILTER
case MiddlePanelActionTypes.MIDDLE_PANEL_FILTER_ALL:
bgstack15