mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
order file-chooser list (#2791)
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import Dirent from '../../models/dirent';
|
||||
import { Utils } from '../../utils/utils';
|
||||
|
||||
const propTypes = {
|
||||
isShowFile: PropTypes.bool,
|
||||
@@ -52,6 +53,7 @@ class DirentListItem extends React.Component {
|
||||
direntList.push(dirent);
|
||||
}
|
||||
}
|
||||
direntList = Utils.sortDirents(direntList, 'name', 'asc');
|
||||
this.setState({
|
||||
hasRequest: true,
|
||||
direntList: direntList,
|
||||
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import Dirent from '../../models/dirent';
|
||||
import DirentListItem from './dirent-list-item';
|
||||
import { Utils } from '../../utils/utils';
|
||||
|
||||
const propTypes = {
|
||||
isShowFile: PropTypes.bool,
|
||||
@@ -29,14 +30,14 @@ class DirentListView extends React.Component {
|
||||
if (this.props.isShowFile === true) {
|
||||
let dirent = new Dirent(item);
|
||||
direntList.push(dirent);
|
||||
} else {
|
||||
if (item.type === 'dir') {
|
||||
let dirent = new Dirent(item);
|
||||
direntList.push(dirent);
|
||||
}
|
||||
}
|
||||
else if (item.type === 'dir') {
|
||||
let dirent = new Dirent(item);
|
||||
direntList.push(dirent);
|
||||
}
|
||||
this.setState({
|
||||
direntList: direntList,
|
||||
});
|
||||
direntList = Utils.sortDirents(direntList, 'name', 'asc');
|
||||
this.setState({direntList: direntList});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import RepoListView from './repo-list-view';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import RepoInfo from '../../models/repo-info';
|
||||
|
||||
import '../../css/file-chooser.css';
|
||||
@@ -63,6 +64,7 @@ class FileChooser extends React.Component {
|
||||
repoList.push(repos[i]);
|
||||
repoIdList.push(repos[i].repo_id);
|
||||
}
|
||||
repoList = Utils.sortRepos(repoList, 'name', 'asc');
|
||||
this.setState({
|
||||
repoList: repoList,
|
||||
isOtherRepoShow: !this.state.isOtherRepoShow,
|
||||
|
Reference in New Issue
Block a user