1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +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:
zxj96
2019-04-08 11:35:46 +08:00
committed by Daniel Pan
parent 85195d70a9
commit 07d596f620
13 changed files with 648 additions and 40 deletions

View File

@@ -34,6 +34,8 @@ const propTypes = {
onDirentClick: PropTypes.func.isRequired,
onItemDetails: PropTypes.func.isRequired,
updateDirent: PropTypes.func.isRequired,
switchAnotherMenuToShow: PropTypes.func,
appMenuType: PropTypes.oneOf(['list_view_contextmenu', 'item_contextmenu', 'tree_contextmenu', 'item_op_menu']),
};
class DirentListView extends React.Component {
@@ -48,7 +50,7 @@ class DirentListView extends React.Component {
imageIndex: 0,
isCreateFileDialogShow: false,
fileType: ''
fileType: '',
};
this.isRepoOwner = props.currentRepoInfo.owner_email === username;
@@ -56,6 +58,23 @@ class DirentListView extends React.Component {
this.repoEncrypted = props.currentRepoInfo.encrypted;
}
componentWillReceiveProps(nextProps) {
if (nextProps.appMenuType === 'item_op_menu' || nextProps.appMenuType === 'tree_contextmenu') {
this.setState({isItemFreezed: false});
} else {
this.setState({isItemFreezed: true});
}
}
componentDidUpdate() {
let thead = document.querySelector('thead');
if (thead) {
thead.addEventListener('contextmenu', (e) => {
e.stopPropagation();
})
}
}
onFreezedItem = () => {
this.setState({isItemFreezed: true});
}
@@ -254,7 +273,7 @@ class DirentListView extends React.Component {
<table>
<thead>
<tr>
<th width="3%" className="pl10">
<th width="3%" className="pl10">
<input type="checkbox" className="vam" onChange={this.props.onAllItemSelected} checked={this.props.isAllItemSelected}/>
</th>
<th width="3%" className="pl10">{/*icon */}</th>
@@ -296,6 +315,9 @@ class DirentListView extends React.Component {
onDirentClick={this.props.onDirentClick}
onItemDetails={this.onItemDetails}
showImagePopup={this.showImagePopup}
switchAnotherMenuToShow={this.props.switchAnotherMenuToShow}
appMenuType={this.props.appMenuType}
itemIndex={index}
/>
);
})