aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/js/actions')
-rw-r--r--src/web/js/actions/MiddlePanelActions.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/web/js/actions/MiddlePanelActions.js b/src/web/js/actions/MiddlePanelActions.js
index ab54217e..e1ced2a2 100644
--- a/src/web/js/actions/MiddlePanelActions.js
+++ b/src/web/js/actions/MiddlePanelActions.js
@@ -23,13 +23,13 @@ var shouldFetch = function(filters) {
}
var reloadIfNecessaryAndDispatch = function(dispath_payload) {
if(shouldFetch(dispath_payload)) {
- filters = MiddlePanelStore.getRequestFilter();
+ var filters = MiddlePanelStore.getRequestFilter();
for (var key in filters) {
if(dispath_payload[key] != null) {
filters[key] = dispath_payload[key];
}
}
- jquery.getJSON('/middle_panel', dispath_payload,
+ jquery.getJSON('/middle_panel', filters,
function(payload) {
dispath_payload.articles = payload.articles;
JarrDispatcher.dispatch(dispath_payload);
@@ -52,6 +52,17 @@ var MiddlePanelActions = {
});
});
},
+ search: function(search) {
+ MiddlePanelStore._datas.display_search = true;
+ MiddlePanelStore._datas.query = search.query;
+ MiddlePanelStore._datas.search_content = search.content;
+ MiddlePanelStore._datas.search_content = search.content;
+ this.reload();
+ },
+ search_off: function() {
+ MiddlePanelStore._datas.display_search = false;
+ this.reload();
+ },
removeParentFilter: function() {
reloadIfNecessaryAndDispatch({
type: ActionTypes.PARENT_FILTER,
bgstack15