aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/stores
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-29 00:27:47 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-29 00:27:47 +0100
commit56ab5f6df51ff301a4dccc458eb83917bba49afc (patch)
tree8bd5edbfc9eb3f42b5ab8a407930b5f3ee544303 /src/web/js/stores
parentredoing menu, sorting in place and not in python (diff)
downloadnewspipe-56ab5f6df51ff301a4dccc458eb83917bba49afc.tar.gz
newspipe-56ab5f6df51ff301a4dccc458eb83917bba49afc.tar.bz2
newspipe-56ab5f6df51ff301a4dccc458eb83917bba49afc.zip
wip right panel
Diffstat (limited to 'src/web/js/stores')
-rw-r--r--src/web/js/stores/MenuStore.js3
-rw-r--r--src/web/js/stores/RightPanelStore.js17
2 files changed, 17 insertions, 3 deletions
diff --git a/src/web/js/stores/MenuStore.js b/src/web/js/stores/MenuStore.js
index 6921ae1c..3a87384f 100644
--- a/src/web/js/stores/MenuStore.js
+++ b/src/web/js/stores/MenuStore.js
@@ -8,7 +8,7 @@ var assign = require('object-assign');
var MenuStore = assign({}, EventEmitter.prototype, {
_datas: {filter: 'all', feeds: {}, categories: {},
active_type: null, active_id: null,
- all_unread_count: 0, feed_in_error: false},
+ all_unread_count: 0},
getAll: function() {
return this._datas;
},
@@ -45,7 +45,6 @@ MenuStore.dispatchToken = JarrDispatcher.register(function(action) {
case ActionTypes.RELOAD_MENU:
MenuStore._datas['feeds'] = action.feeds;
MenuStore._datas['categories'] = action.categories;
- MenuStore._datas['feed_in_error'] = action.feed_in_error;
MenuStore._datas['all_unread_count'] = action.all_unread_count;
MenuStore.emitChange();
break;
diff --git a/src/web/js/stores/RightPanelStore.js b/src/web/js/stores/RightPanelStore.js
index 54df1c95..f08be009 100644
--- a/src/web/js/stores/RightPanelStore.js
+++ b/src/web/js/stores/RightPanelStore.js
@@ -3,10 +3,11 @@ var ActionTypes = require('../constants/JarrConstants');
var EventEmitter = require('events').EventEmitter;
var CHANGE_EVENT = 'change_middle_panel';
var assign = require('object-assign');
+var MenuStore = require('../stores/MenuStore');
var RightPanelStore = assign({}, EventEmitter.prototype, {
- _datas: {},
+ _datas: {category: null, feed: null, article: null},
getAll: function() {
return this._datas;
},
@@ -24,6 +25,20 @@ var RightPanelStore = assign({}, EventEmitter.prototype, {
RightPanelStore.dispatchToken = JarrDispatcher.register(function(action) {
switch(action.type) {
+ case ActionTypes.PARENT_FILTER:
+ if(action.filter_id == null) {
+ RightPanelStore._datas.category = null;
+ RightPanelStore._datas.feed = null;
+ } else if(action.filter_type == 'category_id') {
+ RightPanelStore._datas.category = MenuStore._datas.categories[action.filter_id];
+ RightPanelStore._datas.feed = null;
+ } else {
+
+ RightPanelStore._datas.feed = MenuStore._datas.feeds[action.filter_id];
+ RightPanelStore._datas.category = MenuStore._datas.categories[RightPanelStore._datas.feed.category_id];
+ }
+ RightPanelStore.emitChange();
+ break;
default:
// pass
}
bgstack15