aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions/MenuActions.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/js/actions/MenuActions.js')
-rw-r--r--src/web/js/actions/MenuActions.js36
1 files changed, 36 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..ce3a1030
--- /dev/null
+++ b/src/web/js/actions/MenuActions.js
@@ -0,0 +1,36 @@
+var JarrDispatcher = require('../dispatcher/JarrDispatcher');
+var MenuActionTypes = require('../constants/JarrConstants').MenuActionTypes;
+
+
+var MenuActions = {
+ // PARENT FILTERS
+ reload: function() {
+ $.getJSON('/menu', function(payload) {
+ JarrDispatcher.dispatch({
+ type: MenuActionTypes.RELOAD_MENU,
+ categories: payload.categories,
+ all_unread_count: payload.all_unread_count,
+ });
+ });
+ },
+ setFilterMenuAll: function() {
+ JarrDispatcher.dispatch({
+ component: 'menu',
+ type: MenuActionTypes.MENU_FILTER_ALL,
+ });
+ },
+ setFilterMenuUnread: function() {
+ JarrDispatcher.dispatch({
+ component: 'menu',
+ type: MenuActionTypes.MENU_FILTER_UNREAD,
+ });
+ },
+ setFilterMenuError: function() {
+ JarrDispatcher.dispatch({
+ type: MenuActionTypes.MENU_FILTER_ERROR,
+ });
+ },
+
+};
+
+module.exports = MenuActions;
bgstack15