Web: Files: fixed group context menu
This commit is contained in:
parent
19d9a258b9
commit
146891713d
@ -70,7 +70,7 @@ class Row extends React.Component {
|
||||
};
|
||||
|
||||
const onContextMenu = (e) => {
|
||||
rowContextClick && rowContextClick();
|
||||
rowContextClick && rowContextClick(e.button === 2);
|
||||
if (!this.cm.current.menuRef.current) {
|
||||
this.row.current.click(e); //TODO: need fix context menu to global
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ const TableRow = (props) => {
|
||||
const row = useRef();
|
||||
|
||||
const onContextMenu = (e) => {
|
||||
fileContextClick && fileContextClick();
|
||||
fileContextClick && fileContextClick(e.button === 2);
|
||||
if (cm.current && !cm.current.menuRef.current) {
|
||||
row.current.click(e);
|
||||
}
|
||||
|
@ -21,11 +21,12 @@ export default function withFileActions(WrappedFileItem) {
|
||||
id !== -1 && onSelectItem({ id, isFolder });
|
||||
};
|
||||
|
||||
onFileContextClick = () => {
|
||||
onFileContextClick = (isSingleFile) => {
|
||||
const { onSelectItem } = this.props;
|
||||
const { id, isFolder } = this.props.item;
|
||||
|
||||
id !== -1 && onSelectItem({ id, isFolder } /* , true */);
|
||||
id !== -1 &&
|
||||
onSelectItem({ id, isFolder }, false, !isSingleFile || isMobile);
|
||||
};
|
||||
|
||||
onHideContextMenu = () => {
|
||||
|
@ -427,7 +427,7 @@ class Tile extends React.PureComponent {
|
||||
};
|
||||
|
||||
const onContextMenu = (e) => {
|
||||
tileContextClick && tileContextClick();
|
||||
tileContextClick && tileContextClick(e.button === 2);
|
||||
if (!this.cm.current.menuRef.current) {
|
||||
this.tile.current.click(e); //TODO: need fix context menu to global
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ class FilesActionStore {
|
||||
}
|
||||
};
|
||||
|
||||
onSelectItem = ({ id, isFolder }, isBuffer = false) => {
|
||||
onSelectItem = ({ id, isFolder }, isBuffer = false, isSingleFile) => {
|
||||
const {
|
||||
setBufferSelection,
|
||||
selected,
|
||||
@ -500,7 +500,7 @@ class FilesActionStore {
|
||||
(f) => f.id === id && f.isFolder === isFolder
|
||||
);
|
||||
|
||||
if (isSelected === -1) {
|
||||
if (isSelected === -1 || isSingleFile) {
|
||||
setSelected("none");
|
||||
setSelection([item]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user