aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/stores
diff options
context:
space:
mode:
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