mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
repair bug (#3086)
This commit is contained in:
@@ -143,22 +143,32 @@ class FileChooser extends React.Component {
|
|||||||
|
|
||||||
onSearchInfoChanged = (event) => {
|
onSearchInfoChanged = (event) => {
|
||||||
let searchInfo = event.target.value.trim();
|
let searchInfo = event.target.value.trim();
|
||||||
|
|
||||||
|
this.setState({searchInfo: searchInfo});
|
||||||
|
|
||||||
|
if (this.inputValue === searchInfo) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.inputValue = searchInfo;
|
||||||
|
|
||||||
|
if (searchInfo.length === 0) {
|
||||||
|
this.setState({
|
||||||
|
isSearching: false,
|
||||||
|
searchResults: [],
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.state.searchResults.length && searchInfo.length > 0) {
|
if (!this.state.searchResults.length && searchInfo.length > 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSearching: true,
|
isSearching: true,
|
||||||
isResultGot: false,
|
isResultGot: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.setState({searchInfo: searchInfo});
|
|
||||||
if (this.inputValue === searchInfo) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.inputValue = searchInfo;
|
|
||||||
|
|
||||||
if (this.inputValue === '' || this.getValueLength(this.inputValue) < 3) {
|
if (this.inputValue === '' || this.getValueLength(this.inputValue) < 3) {
|
||||||
this.setState({
|
this.setState({isResultGot: false});
|
||||||
isResultGot: false,
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,8 +31,8 @@ class SearchedListItem extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { item, currentItem } = this.props;
|
let { item, currentItem } = this.props;
|
||||||
let fileIconUrl = item.is_dir ? Utils.getFolderIconUrl(false, 24) : Utils.getFileIconUrl(item.name, 24);
|
let fileIconUrl = item.is_dir ? Utils.getFolderIconUrl(false, 192) : Utils.getFileIconUrl(item.name, 192);
|
||||||
let trClass = this.state.highlight ? 'tr-hightlight' : '';
|
let trClass = this.state.highlight ? 'tr-highlight' : '';
|
||||||
if (currentItem) {
|
if (currentItem) {
|
||||||
if (item.repo_id === currentItem.repo_id && item.path === currentItem.path) {
|
if (item.repo_id === currentItem.repo_id && item.path === currentItem.path) {
|
||||||
trClass = 'searched-active';
|
trClass = 'searched-active';
|
||||||
|
Reference in New Issue
Block a user