mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-11 03:41:12 +00:00
Item right menu (#3203)
* Add item right menu * Add item right menu * Pass value bug * Add item right menu * modify style problem * Add some style * Modifying naming issues * Modify Priority * Add showShare jurisdiction and modify priority * Modify subscript to itemIndex * Communication between sibling components * Improve interaction * modify style problem * Promotion isItemFreezed and onUnfreezedItem level * modify bugs * have tree-node bug * Solve tree-node item-click bug * Complete right click menu * modify style * modify style * item-right-menu finash * modify style to dirent-=list-item * modify some style problem * modify styles * stop thead contextmenu
This commit is contained in:
@@ -10,6 +10,7 @@ const propTypes = {
|
||||
onUnFreezedItem: PropTypes.func.isRequired,
|
||||
registerHandlers: PropTypes.func,
|
||||
unregisterHandlers: PropTypes.func,
|
||||
appMenuType: PropTypes.oneOf(['list_view_contextmenu', 'item_contextmenu', 'tree_contextmenu', 'item_op_menu']),
|
||||
};
|
||||
|
||||
class TreeNodeMenu extends React.Component {
|
||||
@@ -27,6 +28,13 @@ class TreeNodeMenu extends React.Component {
|
||||
this.setState({menuList: menuList});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.appMenuType !== 'item_op_menu') {
|
||||
this.setState({isItemMenuShow: false});
|
||||
this.props.onUnFreezedItem();
|
||||
}
|
||||
}
|
||||
|
||||
caculateMenuList() {
|
||||
let { node } = this.props;
|
||||
let menuList = [];
|
||||
@@ -93,8 +101,6 @@ class TreeNodeMenu extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
this.state.isItemMenuShow ? this.props.unregisterHandlers() : this.props.registerHandlers()
|
||||
|
||||
return (
|
||||
<Dropdown isOpen={this.state.isItemMenuShow} toggle={this.toggleOperationMenu}>
|
||||
<DropdownToggle
|
||||
|
Reference in New Issue
Block a user