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