aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions/MenuActions.js
blob: ce3a103003050d2160e173bc524397c454b97cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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