-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include submitted query and provider in “result-selection-ready” event (
#673) * include query in search servlet data * rework to use new store/action instances * Remove unnecessarily added line Co-authored-by: Eduardo Pinho <[email protected]> * remove unnecessary code from requestStore.js * add provider field to event; rework store content --------- Co-authored-by: Eduardo Pinho <[email protected]>
- Loading branch information
1 parent
67c7209
commit 46dc5d8
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
dicoogle/src/main/resources/webapp/js/actions/requestActions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Reflux from "reflux"; | ||
const RequestActions = { | ||
query: Reflux.createAction(), | ||
}; | ||
export { RequestActions }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
dicoogle/src/main/resources/webapp/js/stores/requestStore.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Reflux from "reflux"; | ||
|
||
import { RequestActions } from "../actions/requestActions"; | ||
|
||
const RequestStore = Reflux.createStore({ | ||
listenables: RequestActions, | ||
|
||
init: function() { | ||
this._query = ""; | ||
this._provider = ""; | ||
}, | ||
|
||
onQuery: function(query, provider) { | ||
this._query = query | ||
this._provider = provider | ||
}, | ||
|
||
get: function() { | ||
return { | ||
query: this._query, | ||
provider: this._provider | ||
}; | ||
} | ||
}); | ||
|
||
export { RequestStore }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters