aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-28 14:36:26 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-28 15:08:08 +0100
commit5c8f9fd0376afc034251a73023e43ada4041aa34 (patch)
tree5c97be7bfb9d40256704e5394f475b1250086fd6 /src/web/js/actions
parentrestoring build command (diff)
downloadnewspipe-5c8f9fd0376afc034251a73023e43ada4041aa34.tar.gz
newspipe-5c8f9fd0376afc034251a73023e43ada4041aa34.tar.bz2
newspipe-5c8f9fd0376afc034251a73023e43ada4041aa34.zip
implementing search through articles
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