aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions/MenuActions.js
blob: 4b17d08436c8898f414c9bb894e00fbf969a2034 (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
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,
                all_unread_count: payload.all_unread_count,
            });
        });
    },
    setFilter: function(filter) {
        JarrDispatcher.dispatch({
            type: ActionTypes.MENU_FILTER,
            filter: filter,
        });
    },
};

module.exports = MenuActions;
bgstack15