mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
Merge pull request #3323 from haiwen/tree-view-contextmenu-improve
repair bug
This commit is contained in:
@@ -144,6 +144,12 @@ class TreeView extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let currentRepoInfo = this.props.currentRepoInfo;
|
||||||
|
|
||||||
|
if (currentRepoInfo.permission === 'cloud-edit' || currentRepoInfo.permission === 'preview') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
let x = event.clientX || (event.touches && event.touches[0].pageX);
|
let x = event.clientX || (event.touches && event.touches[0].pageX);
|
||||||
let y = event.clientY || (event.touches && event.touches[0].pageY);
|
let y = event.clientY || (event.touches && event.touches[0].pageY);
|
||||||
|
|
||||||
|
@@ -26,6 +26,11 @@ class WikiDirListItem extends React.Component {
|
|||||||
this.setState({highlight: false});
|
this.setState({highlight: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onContextMenu = (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
onDirentClick = (e) => {
|
onDirentClick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onDirentClick(this.props.dirent);
|
this.props.onDirentClick(this.props.dirent);
|
||||||
@@ -37,7 +42,7 @@ class WikiDirListItem extends React.Component {
|
|||||||
let iconUrl = Utils.getDirentIcon(dirent);
|
let iconUrl = Utils.getDirentIcon(dirent);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
|
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onContextMenu={this.onContextMenu}>
|
||||||
<td className="text-center">
|
<td className="text-center">
|
||||||
<img src={iconUrl} width="24" alt="" />
|
<img src={iconUrl} width="24" alt="" />
|
||||||
</td>
|
</td>
|
||||||
|
@@ -352,7 +352,7 @@ class LibContentView extends React.Component {
|
|||||||
seafileAPI.getFileContent(res.data).then((res) => {
|
seafileAPI.getFileContent(res.data).then((res) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
content: res.data,
|
content: res.data,
|
||||||
filePermission: permission === 'rw',
|
filePermission: permission === 'rw' || permission === 'cloud-edit',
|
||||||
latestContributor: last_modifier_name,
|
latestContributor: last_modifier_name,
|
||||||
lastModified: moment.unix(mtime).fromNow(),
|
lastModified: moment.unix(mtime).fromNow(),
|
||||||
isFileLoading: false,
|
isFileLoading: false,
|
||||||
|
Reference in New Issue
Block a user