mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 10:50:24 +00:00
Modify function naming
This commit is contained in:
@@ -9,7 +9,7 @@ const propTypes = {
|
||||
dirent: PropTypes.object.isRequired,
|
||||
onItemClick: PropTypes.func.isRequired,
|
||||
showImagePopup: PropTypes.func.isRequired,
|
||||
onGridItemContextmenu: PropTypes.func.isRequired,
|
||||
onGridItemContextMenu: PropTypes.func.isRequired,
|
||||
onGridItemClick: PropTypes.func.isRequired,
|
||||
activeDirent: PropTypes.object,
|
||||
onGridItemMouseDown: PropTypes.func,
|
||||
@@ -43,14 +43,14 @@ class DirentGridItem extends React.Component {
|
||||
|
||||
const dirent = this.props.dirent;
|
||||
if (this.props.dirent === this.props.activeDirent) {
|
||||
this.setState({isGridSelected:false})
|
||||
this.setState({isGridSelected: false});
|
||||
if (Utils.imageCheck(dirent.name)) {
|
||||
this.props.showImagePopup(dirent);
|
||||
} else {
|
||||
this.props.onItemClick(dirent);
|
||||
}
|
||||
} else {
|
||||
this.setState({isGridSelected: true})
|
||||
this.setState({isGridSelected: false});
|
||||
this.props.onGridItemClick(this.props.dirent)
|
||||
}
|
||||
}
|
||||
@@ -123,9 +123,9 @@ class DirentGridItem extends React.Component {
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
onGridItemContextmenu = (event) => {
|
||||
onGridItemContextMenu = (event) => {
|
||||
let dirent = this.props.dirent;
|
||||
this.props.onGridItemContextmenu(event, dirent);
|
||||
this.props.onGridItemContextMenu(event, dirent);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -146,7 +146,7 @@ class DirentGridItem extends React.Component {
|
||||
|
||||
return(
|
||||
<Fragment>
|
||||
<li className="grid-item" onContextMenu={this.onGridItemContextmenu} onMouseDown={this.onGridItemMouseDown}>
|
||||
<li className="grid-item" onContextMenu={this.onGridItemContextMenu} onMouseDown={this.onGridItemMouseDown}>
|
||||
<div
|
||||
className={gridClass}
|
||||
draggable="true"
|
||||
|
@@ -354,13 +354,13 @@ class DirentGridView extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
onGridContainContextMenu = (event) => {
|
||||
onGridContainerContextMenu = (event) => {
|
||||
let id = "dirent-grid-container-menu"
|
||||
let menuList = [TextTranslation.NEW_FOLDER, TextTranslation.NEW_FILE];
|
||||
this.handleContextClick(event, id, menuList);
|
||||
}
|
||||
|
||||
onGridItemContextmenu = (event, dirent) => {
|
||||
onGridItemContextMenu = (event, dirent) => {
|
||||
let id = 'grid-item-contextmenu';
|
||||
let menuList = this.getDirentItemMenuList(dirent, true);
|
||||
this.handleContextClick(event, id, menuList, dirent);
|
||||
@@ -483,7 +483,7 @@ class DirentGridView extends React.Component{
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<ul className="grid-view" onClick={this.gridContainerClick} onContextMenu={this.onGridContainContextMenu} onMouseDown={this.onGridContainerMouseDown}>
|
||||
<ul className="grid-view" onClick={this.gridContainerClick} onContextMenu={this.onGridContainerContextMenu} onMouseDown={this.onGridContainerMouseDown}>
|
||||
{
|
||||
direntList.length !== 0 && direntList.map((dirent, index) => {
|
||||
return (
|
||||
@@ -495,7 +495,7 @@ class DirentGridView extends React.Component{
|
||||
onItemClick={this.props.onItemClick}
|
||||
currentRepoInfo={this.props.currentRepoInfo}
|
||||
showImagePopup={this.showImagePopup}
|
||||
onGridItemContextmenu={this.onGridItemContextmenu}
|
||||
onGridItemContextMenu={this.onGridItemContextMenu}
|
||||
onItemMove={this.props.onItemMove}
|
||||
onGridItemMouseDown={this.onGridItemMouseDown}
|
||||
onGridItemClick={this.onGridItemClick}
|
||||
|
Reference in New Issue
Block a user