исправления

This commit is contained in:
Alexey Kasyanchuk 2017-01-18 22:40:04 +03:00
parent 00256750e0
commit b6863af73e

View File

@ -28,7 +28,7 @@ export default class Search extends Component {
}); });
this.searchData = []; this.searchData = [];
let queries = 2; let queries = 2;
window.torrentSocket.emit('searchTorrent', this.searchValue, {limit: 10, safeSearch: this.refs.safeSearch.checked}, window.customLoader((torrents) => { window.torrentSocket.emit('searchTorrent', this.searchValue, {limit: 10, safeSearch: !this.notSafeSearch}, window.customLoader((torrents) => {
if(torrents) { if(torrents) {
this.searchData = this.searchData.concat(torrents); this.searchData = this.searchData.concat(torrents);
} }
@ -40,7 +40,7 @@ export default class Search extends Component {
this.forceUpdate(); this.forceUpdate();
} }
})); }));
window.torrentSocket.emit('searchFiles', this.searchValue, {limit: 10, safeSearch: this.refs.safeSearch.checked}, window.customLoader((torrents) => { window.torrentSocket.emit('searchFiles', this.searchValue, {limit: 10, safeSearch: !this.notSafeSearch}, window.customLoader((torrents) => {
if(torrents) { if(torrents) {
this.searchData = this.searchData.concat(torrents); this.searchData = this.searchData.concat(torrents);
} }
@ -100,9 +100,10 @@ export default class Search extends Component {
ref='safeSearch' ref='safeSearch'
checkedIcon={<Visibility />} checkedIcon={<Visibility />}
uncheckedIcon={<VisibilityOff />} uncheckedIcon={<VisibilityOff />}
label={<span className='text-nowrap' style={{fontSize: '0.9em', color: 'grey'}}>{this.state.safeSearchText}</span>} label={<span className='text-nowrap' style={{fontSize: '0.87em', transition: '0.1s', color: this.state.safeSearchColor}}>{this.state.safeSearchText}</span>}
iconStyle={{fill: this.state.safeSearchColor}} iconStyle={{fill: this.state.safeSearchColor}}
onCheck={(ev, ch) => { onCheck={(ev, ch) => {
this.notSafeSearch = ch;
if(ch) if(ch)
{ {
this.setState({safeSearchText: 'safe search disabled', safeSearchColor: '#EC407A'}); this.setState({safeSearchText: 'safe search disabled', safeSearchColor: '#EC407A'});
@ -112,6 +113,7 @@ export default class Search extends Component {
this.setState({safeSearchText: 'safe search enabled', safeSearchColor: 'rgb(0, 188, 212)'}); this.setState({safeSearchText: 'safe search enabled', safeSearchColor: 'rgb(0, 188, 212)'});
} }
}} }}
style={{paddingBottom: '0.8em'}}
/> />
</div> </div>
{ {