Skip to content

Commit

Permalink
* remove scroll and load buttons from top
Browse files Browse the repository at this point in the history
  • Loading branch information
CalamityC committed Mar 22, 2024
1 parent 39c1283 commit 5a70b57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
12 changes: 2 additions & 10 deletions rdmo/projects/assets/js/components/helper/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const Table = ({
initialRows = '20',
projectsActions,
rowsToLoad = '10',
scrollToBottom,
scrollToTop,
sortableColumns,
/* order of elements in 'visibleColumns' corresponds to order of columns in table */
Expand Down Expand Up @@ -47,16 +46,11 @@ const Table = ({
configActions.updateConfig('tableRows', data.length.toString())
}

const renderLoadButtons = (position) => {
const renderLoadButtons = () => {
return (
displayedRows && (
<div className="icon-container ml-auto">
{position === 'top' && // data.length > 0 &&
<button className="btn" onClick={scrollToBottom} title={gettext('Scroll to bottom')}>
<i className="fa fa-arrow-down" aria-hidden="true"></i>
</button>
}
{position === 'bottom' && // data.length > 0 &&
{data.length > 0 &&
<button className="btn" onClick={scrollToTop} title={gettext('Scroll to top')}>
<i className="fa fa-arrow-up" aria-hidden="true"></i>
</button>
Expand Down Expand Up @@ -145,7 +139,6 @@ const Table = ({

return (
<div className="table-container">
{renderLoadButtons('top')}
<table className="table table-borderless">
{renderHeaders()}
{renderRows()}
Expand All @@ -165,7 +158,6 @@ Table.propTypes = {
initialRows: PropTypes.string,
projectsActions: PropTypes.object,
rowsToLoad: PropTypes.string,
scrollToBottom: PropTypes.func,
scrollToTop: PropTypes.func,
sortableColumns: PropTypes.arrayOf(PropTypes.string),
visibleColumns: PropTypes.arrayOf(PropTypes.string),
Expand Down
5 changes: 0 additions & 5 deletions rdmo/projects/assets/js/components/main/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ const Projects = ({ config, configActions, currentUserObject, projectsActions, p
window.scrollTo({ top: 0, behavior: 'smooth' })
}

const scrollToBottom = () => {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })
}

const displayedRows = get(config, 'tableRows', '')

const currentUserId = currentUser.id
Expand Down Expand Up @@ -209,7 +205,6 @@ const Projects = ({ config, configActions, currentUserObject, projectsActions, p
data={projects}
headerFormatters={headerFormatters}
projectsActions={projectsActions}
scrollToBottom={scrollToBottom}
scrollToTop={scrollToTop}
sortableColumns={sortableColumns}
visibleColumns={visibleColumns}
Expand Down

0 comments on commit 5a70b57

Please sign in to comment.