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) {
|
while (term.indexOf('&') > -1) {
|
||||||
term = term.substring(0, term.indexOf('&'));
|
term = term.substring(0, term.indexOf('&'));
|
||||||
}
|
}
|
||||||
term = term.split('+').join(' ');
|
term = decodeURI(term.split('+').join(' '));
|
||||||
this.getSearchMore();
|
this.props.dispatch(navigationActions.setSearchTerm(term));
|
||||||
this.props.dispatch(navigationActions.setSearchTerm(decodeURI(term)));
|
},
|
||||||
|
componentDidUpdate: function (nextProps) {
|
||||||
|
if (this.props.searchTerm !== nextProps.searchTerm) this.getSearchMore();
|
||||||
},
|
},
|
||||||
getSearchMore: function () {
|
getSearchMore: function () {
|
||||||
var termText = '';
|
var termText = '';
|
||||||
if (this.props.searchTerm !== '') {
|
if (this.props.searchTerm !== '') {
|
||||||
termText = '&q=' + this.props.searchTerm;
|
termText = '&q=' + encodeURIComponent(this.props.searchTerm.split(' ').join('+'));
|
||||||
}
|
}
|
||||||
api({
|
api({
|
||||||
uri: '/search/' + this.props.tab +
|
uri: '/search/' + this.props.tab +
|
||||||
|
|
Loading…
Reference in a new issue