mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 10:50:24 +00:00
Grid view support drag drop item to path (#6429)
* feature - drag and drop file to target path in grid view fix typo * update target path item background color when drag enter * fix bug - select-all checkbox is actived after the last item is moved to another path * fix bug - drag drop action conflict with multi-select by keyboard * remove console log * fix type error
This commit is contained in:
@@ -56,27 +56,27 @@ class DirentGridItem extends React.Component {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const { dirent, activeDirent } = this.props;
|
||||
const { dirent } = this.props;
|
||||
|
||||
if (this.clickTimeout) {
|
||||
clearTimeout(this.clickTimeout);
|
||||
this.clickTimeout = null;
|
||||
this.handleSingleClick(dirent, activeDirent, e);
|
||||
this.handleSingleClick(dirent, e);
|
||||
return;
|
||||
}
|
||||
|
||||
this.clickTimeout = setTimeout(() => {
|
||||
this.clickTimeout = null;
|
||||
this.handleSingleClick(dirent, activeDirent, e);
|
||||
this.handleSingleClick(dirent, e);
|
||||
}, 100); // Clicks within 100 milliseconds is considered a single click.
|
||||
};
|
||||
|
||||
handleSingleClick = (dirent, activeDirent, event) => {
|
||||
handleSingleClick = (dirent, event) => {
|
||||
if (!this.canPreview) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (dirent === activeDirent && !event.metaKey && !event.ctrlKey) {
|
||||
if (dirent.isSelected && !event.metaKey && !event.ctrlKey) {
|
||||
this.handleDoubleClick(dirent, event);
|
||||
} else {
|
||||
this.props.onGridItemClick(dirent, event);
|
||||
@@ -113,6 +113,7 @@ class DirentGridItem extends React.Component {
|
||||
if (Utils.isIEBrower() || !this.canDrag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let dragStartItemData = { nodeDirent: this.props.dirent, nodeParentPath: this.props.path };
|
||||
dragStartItemData = JSON.stringify(dragStartItemData);
|
||||
|
||||
|
@@ -597,7 +597,6 @@ class DirentGridView extends React.Component {
|
||||
|
||||
onGridItemMouseDown = (event) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if (event.button === 2) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user