mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 17:33:18 +00:00
[dirent details panel] fixup & improvement (#2844)
* [dirent details panel] fixup & improvement * [my libs] details: click item to show details when details panel is open
This commit is contained in:
@@ -32,6 +32,7 @@ const propTypes = {
|
||||
onItemMove: PropTypes.func.isRequired,
|
||||
onItemCopy: PropTypes.func.isRequired,
|
||||
onItemDetails: PropTypes.func.isRequired,
|
||||
onDirentClick: PropTypes.func.isRequired,
|
||||
updateDirent: PropTypes.func.isRequired,
|
||||
currentRepoInfo: PropTypes.object,
|
||||
isRepoOwner: PropTypes.bool,
|
||||
@@ -111,6 +112,14 @@ class DirentListItem extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
// on '<tr>'
|
||||
onDirentClick = (e) => {
|
||||
// '<td>' is clicked
|
||||
if (e.target.tagName == 'TD') {
|
||||
this.props.onDirentClick(this.props.dirent);
|
||||
}
|
||||
}
|
||||
|
||||
onItemClick = (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -383,7 +392,7 @@ class DirentListItem extends React.Component {
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave}>
|
||||
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave} onClick={this.onDirentClick}>
|
||||
<td className="text-center">
|
||||
<input type="checkbox" className="vam" onChange={this.onItemSelected} checked={dirent.isSelected}/>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user