diff options
Diffstat (limited to 'src/web/js/actions')
-rw-r--r-- | src/web/js/actions/MenuActions.js | 5 | ||||
-rw-r--r-- | src/web/js/actions/MiddlePanelActions.js | 6 | ||||
-rw-r--r-- | src/web/js/actions/RightPanelActions.js | 8 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/web/js/actions/MenuActions.js b/src/web/js/actions/MenuActions.js index b9154581..824610d8 100644 --- a/src/web/js/actions/MenuActions.js +++ b/src/web/js/actions/MenuActions.js @@ -5,7 +5,7 @@ var jquery = require('jquery'); var MenuActions = { // PARENT FILTERS - reload: function() { + reload: function(setFilterFunc, id) { jquery.getJSON('/menu', function(payload) { JarrDispatcher.dispatch({ type: ActionTypes.RELOAD_MENU, @@ -18,6 +18,9 @@ var MenuActions = { crawling_method: payload.crawling_method, all_unread_count: payload.all_unread_count, }); + if(setFilterFunc && id) { + setFilterFunc(id); + } }); }, setFilter: function(filter) { diff --git a/src/web/js/actions/MiddlePanelActions.js b/src/web/js/actions/MiddlePanelActions.js index f805b7b1..3704e7ec 100644 --- a/src/web/js/actions/MiddlePanelActions.js +++ b/src/web/js/actions/MiddlePanelActions.js @@ -140,11 +140,9 @@ var MiddlePanelActions = { data: JSON.stringify(filters), url: "/mark_all_as_read", success: function (payload) { + console.log(payload); JarrDispatcher.dispatch({ - type: ActionTypes.CHANGE_ATTR, - attribute: 'read', - value_num: -1, - value_bool: true, + type: ActionTypes.MARK_ALL_AS_READ, articles: payload.articles, }); }, diff --git a/src/web/js/actions/RightPanelActions.js b/src/web/js/actions/RightPanelActions.js index 47adad79..5d78e001 100644 --- a/src/web/js/actions/RightPanelActions.js +++ b/src/web/js/actions/RightPanelActions.js @@ -4,8 +4,12 @@ var ActionTypes = require('../constants/JarrConstants'); var MenuActions = require('../actions/MenuActions'); var RightPanelActions = { - loadArticle: function(article_id, was_read_before) { - jquery.getJSON('/getart/' + article_id, + loadArticle: function(article_id, was_read_before, to_parse) { + var suffix = ''; + if(to_parse) { + suffix = '/parse'; + } + jquery.getJSON('/getart/' + article_id + suffix, function(payload) { JarrDispatcher.dispatch({ type: ActionTypes.LOAD_ARTICLE, |