aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions/MenuActions.js
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-02-02 23:15:37 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-02-02 23:15:37 +0100
commit082bf39a7dd7296d4f51b6b124d185135dc00989 (patch)
tree6e12cf2b67b016aff38874c389b5bf8b5242749a /src/web/js/actions/MenuActions.js
parentfixing logging (diff)
parentreload and fold all button (diff)
downloadnewspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.gz
newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.bz2
newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.zip
Merge branch 'feature/categories'
close #22 close #23
Diffstat (limited to 'src/web/js/actions/MenuActions.js')
-rw-r--r--src/web/js/actions/MenuActions.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/web/js/actions/MenuActions.js b/src/web/js/actions/MenuActions.js
new file mode 100644
index 00000000..b9154581
--- /dev/null
+++ b/src/web/js/actions/MenuActions.js
@@ -0,0 +1,37 @@
+var JarrDispatcher = require('../dispatcher/JarrDispatcher');
+var ActionTypes = require('../constants/JarrConstants');
+var jquery = require('jquery');
+
+
+var MenuActions = {
+ // PARENT FILTERS
+ reload: function() {
+ jquery.getJSON('/menu', function(payload) {
+ JarrDispatcher.dispatch({
+ type: ActionTypes.RELOAD_MENU,
+ feeds: payload.feeds,
+ categories: payload.categories,
+ categories_order: payload.categories_order,
+ is_admin: payload.is_admin,
+ max_error: payload.max_error,
+ error_threshold: payload.error_threshold,
+ crawling_method: payload.crawling_method,
+ all_unread_count: payload.all_unread_count,
+ });
+ });
+ },
+ setFilter: function(filter) {
+ JarrDispatcher.dispatch({
+ type: ActionTypes.MENU_FILTER,
+ filter: filter,
+ });
+ },
+ toggleAllFolding: function(all_folded) {
+ JarrDispatcher.dispatch({
+ type: ActionTypes.TOGGLE_MENU_FOLD,
+ all_folded: all_folded,
+ });
+ },
+};
+
+module.exports = MenuActions;
bgstack15