mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
parent
0313346fed
commit
405763246d
1 changed files with 6 additions and 4 deletions
|
@ -51,14 +51,16 @@ var Search = injectIntl(React.createClass({
|
|||
while (term.indexOf('&') > -1) {
|
||||
term = term.substring(0, term.indexOf('&'));
|
||||
}
|
||||
term = term.split('+').join(' ');
|
||||
this.getSearchMore();
|
||||
this.props.dispatch(navigationActions.setSearchTerm(decodeURI(term)));
|
||||
term = decodeURI(term.split('+').join(' '));
|
||||
this.props.dispatch(navigationActions.setSearchTerm(term));
|
||||
},
|
||||
componentDidUpdate: function (nextProps) {
|
||||
if (this.props.searchTerm !== nextProps.searchTerm) this.getSearchMore();
|
||||
},
|
||||
getSearchMore: function () {
|
||||
var termText = '';
|
||||
if (this.props.searchTerm !== '') {
|
||||
termText = '&q=' + this.props.searchTerm;
|
||||
termText = '&q=' + encodeURIComponent(this.props.searchTerm.split(' ').join('+'));
|
||||
}
|
||||
api({
|
||||
uri: '/search/' + this.props.tab +
|
||||
|
|
Loading…
Reference in a new issue