mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
Use state change directory array
This commit is contained in:
@@ -85,6 +85,8 @@ const propTypes = {
|
||||
showDirentDetail: PropTypes.func.isRequired,
|
||||
onDeleteRepoTag: PropTypes.func.isRequired,
|
||||
updateDetail: PropTypes.bool.isRequired,
|
||||
scrollPage: PropTypes.func.isRequired,
|
||||
isCurrentPage: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
class LibContentContainer extends React.Component {
|
||||
@@ -204,6 +206,8 @@ class LibContentContainer extends React.Component {
|
||||
onItemsCopy={this.props.onItemsCopy}
|
||||
onItemsDelete={this.props.onItemsDelete}
|
||||
onFileTagChanged={this.props.onFileTagChanged}
|
||||
isCurrentPage={this.props.isCurrentPage}
|
||||
scrollPage={this.props.scrollPage}
|
||||
/>
|
||||
)}
|
||||
{this.props.currentMode === 'grid' && (
|
||||
@@ -235,6 +239,8 @@ class LibContentContainer extends React.Component {
|
||||
isDirentDetailShow={this.props.isDirentDetailShow}
|
||||
onItemRename={this.props.onItemRename}
|
||||
onFileTagChanged={this.props.onFileTagChanged}
|
||||
isCurrentPage={this.props.isCurrentPage}
|
||||
scrollPage={this.props.scrollPage}
|
||||
/>
|
||||
)}
|
||||
{this.props.currentMode === 'column' && (
|
||||
@@ -295,6 +301,8 @@ class LibContentContainer extends React.Component {
|
||||
onItemsCopy={this.props.onItemsCopy}
|
||||
onItemsDelete={this.props.onItemsDelete}
|
||||
onFileTagChanged={this.props.onFileTagChanged}
|
||||
isCurrentPage={this.props.isCurrentPage}
|
||||
scrollPage={this.props.scrollPage}
|
||||
/>
|
||||
)}
|
||||
</Fragment>
|
||||
|
@@ -71,6 +71,7 @@ class LibContentView extends React.Component {
|
||||
errorMsg: '',
|
||||
isDirentDetailShow: false,
|
||||
updateDetail: false,
|
||||
isCurrentPage: false,
|
||||
};
|
||||
|
||||
window.onpopstate = this.onpopstate;
|
||||
@@ -402,6 +403,7 @@ class LibContentView extends React.Component {
|
||||
if (!this.state.repoEncrypted && direntList.length) {
|
||||
this.getThumbnails(repoID, path, this.state.direntList);
|
||||
}
|
||||
this.switchPage();
|
||||
}).catch(() => {
|
||||
this.setState({
|
||||
isDirentListLoading: false,
|
||||
@@ -410,6 +412,14 @@ class LibContentView extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
scrollPage = () => {
|
||||
this.setState({isCurrentPage: false})
|
||||
}
|
||||
|
||||
switchPage = () => {
|
||||
this.setState({isCurrentPage: true})
|
||||
}
|
||||
|
||||
getThumbnails = (repoID, path, direntList) => {
|
||||
let items = direntList.filter((item) => {
|
||||
return Utils.imageCheck(item.name) && !item.encoded_thumbnail_src;
|
||||
@@ -1451,6 +1461,8 @@ class LibContentView extends React.Component {
|
||||
onDeleteRepoTag={this.onDeleteRepoTag}
|
||||
onToolbarFileTagChanged={this.onToolbarFileTagChanged}
|
||||
updateDetail={this.state.updateDetail}
|
||||
isCurrentPage={this.state.isCurrentPage}
|
||||
scrollPage={this.scrollPage}
|
||||
/>
|
||||
{this.state.pathExist && !this.state.isViewFile && (
|
||||
<FileUploader
|
||||
|
Reference in New Issue
Block a user