diff --git a/frontend/src/components/dir-view-mode/dir-column-nav.js b/frontend/src/components/dir-view-mode/dir-column-nav.js index a46b40766d..eddad71662 100644 --- a/frontend/src/components/dir-view-mode/dir-column-nav.js +++ b/frontend/src/components/dir-view-mode/dir-column-nav.js @@ -248,12 +248,16 @@ class DirColumnNav extends React.Component { })); } + stopTreeScrollPropagation = (e) => { + e.stopPropagation(); + } + render() { let flex = this.props.navRate ? '0 0 ' + this.props.navRate * 100 + '%' : '0 0 25%'; const select = this.props.inResizing ? 'none' : ''; return ( -
+
{this.props.isTreeDataLoading ? () : ( )} { this.setState({isMoveDialogShow: !this.state.isMoveDialogShow}); } diff --git a/frontend/src/pages/lib-content-view/lib-content-container.js b/frontend/src/pages/lib-content-view/lib-content-container.js index df95bbfb4d..2a0d1dca1a 100644 --- a/frontend/src/pages/lib-content-view/lib-content-container.js +++ b/frontend/src/pages/lib-content-view/lib-content-container.js @@ -85,6 +85,7 @@ const propTypes = { showDirentDetail: PropTypes.func.isRequired, onDeleteRepoTag: PropTypes.func.isRequired, updateDetail: PropTypes.bool.isRequired, + onListContainerScroll: PropTypes.func.isRequired, }; class LibContentContainer extends React.Component { @@ -138,6 +139,13 @@ class LibContentContainer extends React.Component { this.props.onItemDelete(dirent); } + onItemsScroll = (e) => { + let target = e.target; + if (target.scrollTop + document.documentElement.clientHeight - target.offsetTop >= target.scrollHeight) { + this.props.onListContainerScroll(); + } + } + render() { let { path, repoID, usedRepoTags, readmeMarkdown, draftCounts } = this.props; let isRepoInfoBarShow = false; @@ -165,7 +173,7 @@ class LibContentContainer extends React.Component { onDeleteRepoTag={this.props.onDeleteRepoTag} />
-
+
{!this.props.pathExist && this.errMessage} {this.props.pathExist && ( @@ -234,6 +242,7 @@ class LibContentContainer extends React.Component { onGridItemClick={this.onGridItemClick} isDirentDetailShow={this.props.isDirentDetailShow} onItemRename={this.props.onItemRename} + onFileTagChanged={this.props.onFileTagChanged} /> )} {this.props.currentMode === 'column' && ( diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js index 7ed70b32ab..2d7f016428 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -71,6 +71,7 @@ class LibContentView extends React.Component { errorMsg: '', isDirentDetailShow: false, updateDetail: false, + itemsShowLength: 100, }; this.oldonpopstate = window.onpopstate; @@ -404,6 +405,7 @@ class LibContentView extends React.Component { if (!this.state.repoEncrypted && direntList.length) { this.getThumbnails(repoID, path, this.state.direntList); } + this.resetShowLength(); }).catch(() => { this.setState({ isDirentListLoading: false, @@ -412,6 +414,15 @@ class LibContentView extends React.Component { }); } + onListContainerScroll = () => { + let itemsShowLength = this.state.itemsShowLength + 100; + this.setState({itemsShowLength: itemsShowLength}); + } + + resetShowLength = () => { + this.setState({itemsShowLength: 100}); + } + getThumbnails = (repoID, path, direntList) => { let items = direntList.filter((item) => { return Utils.imageCheck(item.name) && !item.encoded_thumbnail_src; @@ -1336,6 +1347,10 @@ class LibContentView extends React.Component { } + let direntItemsList = this.state.direntList.filter((item, index) => { + return index < this.state.itemsShowLength; + }) + return (
@@ -1423,7 +1438,7 @@ class LibContentView extends React.Component { readmeMarkdown={this.state.readmeMarkdown} updateUsedRepoTags={this.updateUsedRepoTags} isDirentListLoading={this.state.isDirentListLoading} - direntList={this.state.direntList} + direntList={direntItemsList} showShareBtn={showShareBtn} sortBy={this.state.sortBy} sortOrder={this.state.sortOrder} @@ -1453,6 +1468,7 @@ class LibContentView extends React.Component { onDeleteRepoTag={this.onDeleteRepoTag} onToolbarFileTagChanged={this.onToolbarFileTagChanged} updateDetail={this.state.updateDetail} + onListContainerScroll={this.onListContainerScroll} /> {this.state.pathExist && !this.state.isViewFile && (