mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 06:44:16 +00:00
optimized code (#4277)
This commit is contained in:
@@ -198,6 +198,10 @@ class ContextMenu extends React.Component {
|
|||||||
this.props.onMenuItemClick(operation, currentObject, event);
|
this.props.onMenuItemClick(operation, currentObject, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onContextMenu = (event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const inlineStyle = { position: 'fixed', opacity: 0, pointerEvents: 'none', display: 'block' };
|
const inlineStyle = { position: 'fixed', opacity: 0, pointerEvents: 'none', display: 'block' };
|
||||||
return (
|
return (
|
||||||
@@ -212,6 +216,7 @@ class ContextMenu extends React.Component {
|
|||||||
className="seafile-contextmenu-item dropdown-item"
|
className="seafile-contextmenu-item dropdown-item"
|
||||||
data-operation={menuItem.key}
|
data-operation={menuItem.key}
|
||||||
onClick={this.onMenuItemClick}
|
onClick={this.onMenuItemClick}
|
||||||
|
onContextMenu={this.onContextMenu}
|
||||||
>
|
>
|
||||||
{menuItem.value}
|
{menuItem.value}
|
||||||
</button>
|
</button>
|
||||||
|
Reference in New Issue
Block a user