Streamlining search triggers and sub-views
This commit is contained in:
@ -26,8 +26,9 @@ class SearchForm extends React.Component{
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps){
|
||||
if (newProps.query && newProps.query != this.state.query && newProps.query != this.props.query && !this.state.in_focus){
|
||||
this.setState({query: newProps.query})
|
||||
if (newProps.query && newProps.query != this.state.query && !this.state.in_focus){
|
||||
this.setState({query: newProps.query});
|
||||
console.log(newProps.query);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +51,7 @@ class SearchForm extends React.Component{
|
||||
break
|
||||
|
||||
default:
|
||||
hashHistory.push(global.baseURL+'search/iris:search:'+encodeURIComponent(this.state.query))
|
||||
hashHistory.push(global.baseURL+'search/search:'+this.props.view+':'+encodeURIComponent(this.state.query));
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,10 @@ export default class URILink extends React.Component{
|
||||
|
||||
render(){
|
||||
var to = null;
|
||||
var uri = encodeURIComponent(this.props.uri);
|
||||
var uri = this.props.uri;
|
||||
if (!this.props.unencoded){
|
||||
uri = encodeURIComponent(uri);
|
||||
}
|
||||
|
||||
switch (this.props.type){
|
||||
|
||||
@ -44,6 +47,10 @@ export default class URILink extends React.Component{
|
||||
to = global.baseURL+'discover/recommendations/'+uri;
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
to = global.baseURL+'search/'+uri;
|
||||
break;
|
||||
|
||||
default:
|
||||
to = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user