mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
Fix eslint warnings (#5635)
* 01 fix eslint warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings * fix code warnings
This commit is contained in:
@@ -17,9 +17,8 @@ import ShareDialog from '../dialog/share-dialog';
|
||||
import ZipDownloadDialog from '../dialog/zip-download-dialog';
|
||||
import EditFileTagDialog from '../dialog/edit-filetag-dialog';
|
||||
import LibSubFolderPermissionDialog from '../dialog/lib-sub-folder-permission-dialog';
|
||||
|
||||
import '../../css/dirent-list-item.css';
|
||||
import toaster from '../toast';
|
||||
import '../../css/dirent-list-item.css';
|
||||
|
||||
const propTypes = {
|
||||
path: PropTypes.string.isRequired,
|
||||
@@ -53,6 +52,7 @@ const propTypes = {
|
||||
showDirentDetail: PropTypes.func.isRequired,
|
||||
onItemsMove: PropTypes.func.isRequired,
|
||||
onShowDirentsDraggablePreview: PropTypes.func,
|
||||
loadDirentList: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class DirentListItem extends React.Component {
|
||||
@@ -107,7 +107,7 @@ class DirentListItem extends React.Component {
|
||||
this.setState({
|
||||
isOpMenuOpen: !this.state.isOpMenuOpen
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//UI Interactive
|
||||
onMouseEnter = () => {
|
||||
@@ -120,7 +120,7 @@ class DirentListItem extends React.Component {
|
||||
if (this.state.canDrag) {
|
||||
this.setState({isDragTipShow: true});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMouseOver = () => {
|
||||
if (!this.props.isItemFreezed) {
|
||||
@@ -132,7 +132,7 @@ class DirentListItem extends React.Component {
|
||||
if (this.state.canDrag) {
|
||||
this.setState({isDragTipShow: true});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMouseLeave = () => {
|
||||
if (!this.props.isItemFreezed) {
|
||||
@@ -142,7 +142,7 @@ class DirentListItem extends React.Component {
|
||||
});
|
||||
}
|
||||
this.setState({isDragTipShow: false});
|
||||
}
|
||||
};
|
||||
|
||||
unfreezeItem = () => {
|
||||
this.setState({
|
||||
@@ -150,12 +150,12 @@ class DirentListItem extends React.Component {
|
||||
isOperationShow: false,
|
||||
});
|
||||
this.props.unfreezeItem();
|
||||
}
|
||||
};
|
||||
|
||||
//buiness handler
|
||||
onItemSelected = () => {
|
||||
this.props.onItemSelected(this.props.dirent);
|
||||
}
|
||||
};
|
||||
|
||||
onItemStarred = (e) => {
|
||||
let dirent = this.props.dirent;
|
||||
@@ -179,7 +179,7 @@ class DirentListItem extends React.Component {
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// on '<tr>'
|
||||
onDirentClick = (e) => {
|
||||
@@ -188,7 +188,7 @@ class DirentListItem extends React.Component {
|
||||
if (e.target.tagName == 'TD') {
|
||||
this.props.onDirentClick(this.props.dirent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onItemClick = (e) => {
|
||||
e.preventDefault();
|
||||
@@ -211,28 +211,28 @@ class DirentListItem extends React.Component {
|
||||
} else {
|
||||
this.props.onItemClick(dirent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onItemDelete = (e) => {
|
||||
e.preventDefault();
|
||||
e.nativeEvent.stopImmediatePropagation(); //for document event
|
||||
this.props.onItemDelete(this.props.dirent);
|
||||
}
|
||||
};
|
||||
|
||||
onItemShare = (e) => {
|
||||
e.preventDefault();
|
||||
e.nativeEvent.stopImmediatePropagation(); //for document event
|
||||
this.setState({isShareDialogShow: !this.state.isShareDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
closeSharedDialog = () => {
|
||||
this.setState({isShareDialogShow: !this.state.isShareDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onMobileMenuItemClick = (e) => {
|
||||
const operation = e.target.getAttribute('data-op');
|
||||
this.onMenuItemClick(operation, e);
|
||||
}
|
||||
};
|
||||
|
||||
onMenuItemClick = (operation, event) => {
|
||||
switch(operation) {
|
||||
@@ -295,18 +295,18 @@ class DirentListItem extends React.Component {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onEditFileTagToggle = () => {
|
||||
this.setState({
|
||||
isEditFileTagShow: !this.state.isEditFileTagShow
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onFileTagChanged = () => {
|
||||
let direntPath = this.getDirentPath(this.props.dirent);
|
||||
this.props.onFileTagChanged(this.props.dirent, direntPath);
|
||||
}
|
||||
};
|
||||
|
||||
onItemRenameToggle = () => {
|
||||
this.props.onItemRenameToggle(this.props.dirent);
|
||||
@@ -315,12 +315,12 @@ class DirentListItem extends React.Component {
|
||||
isRenameing: true,
|
||||
canDrag: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onRenameConfirm = (newName) => {
|
||||
this.props.onItemRename(this.props.dirent, newName);
|
||||
this.onRenameCancel();
|
||||
}
|
||||
};
|
||||
|
||||
onRenameCancel = () => {
|
||||
this.setState({
|
||||
@@ -328,19 +328,19 @@ class DirentListItem extends React.Component {
|
||||
canDrag: this.canDrag // set it back to the initial value
|
||||
});
|
||||
this.unfreezeItem();
|
||||
}
|
||||
};
|
||||
|
||||
onItemMoveToggle = () => {
|
||||
this.setState({isMoveDialogShow: !this.state.isMoveDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onItemCopyToggle = () => {
|
||||
this.setState({isCopyDialogShow: !this.state.isCopyDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onPermissionItem = () => {
|
||||
this.setState({isPermissionDialogOpen: !this.state.isPermissionDialogOpen});
|
||||
}
|
||||
};
|
||||
|
||||
onLockItem = () => {
|
||||
let repoID = this.props.repoID;
|
||||
@@ -354,7 +354,7 @@ class DirentListItem extends React.Component {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onUnlockItem = () => {
|
||||
let repoID = this.props.repoID;
|
||||
@@ -367,7 +367,7 @@ class DirentListItem extends React.Component {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onMarkAsDraft = () => {
|
||||
let repoID = this.props.repoID;
|
||||
@@ -378,7 +378,7 @@ class DirentListItem extends React.Component {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onUnmarkAsDraft = () => {
|
||||
let repoID = this.props.repoID;
|
||||
@@ -389,40 +389,40 @@ class DirentListItem extends React.Component {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onHistory = () => {
|
||||
let repoID = this.props.repoID;
|
||||
let filePath = this.getDirentPath(this.props.dirent);
|
||||
let url = URLDecorator.getUrl({type: 'file_revisions', repoID: repoID, filePath: filePath});
|
||||
location.href = url;
|
||||
}
|
||||
};
|
||||
|
||||
onAccessLog = () => {
|
||||
let filePath = this.getDirentPath(this.props.dirent);
|
||||
let path = siteRoot + 'repo/file-access/' + this.props.repoID + '/?p=' + encodeURIComponent(filePath) ;
|
||||
window.open(path);
|
||||
}
|
||||
};
|
||||
|
||||
onOpenViaClient = () => {
|
||||
let repoID = this.props.repoID;
|
||||
let filePath = this.getDirentPath(this.props.dirent);
|
||||
let url = URLDecorator.getUrl({type: 'open_via_client', repoID: repoID, filePath: filePath});
|
||||
location.href = url;
|
||||
}
|
||||
};
|
||||
|
||||
onConvertWithONLYOFFICE = ()=> {
|
||||
|
||||
let repoID = this.props.repoID;
|
||||
let filePath = this.getDirentPath(this.props.dirent)
|
||||
let filePath = this.getDirentPath(this.props.dirent);
|
||||
|
||||
seafileAPI.onlyofficeConvert(repoID, filePath).then(res => {
|
||||
this.props.loadDirentList(res.data.parent_dir)
|
||||
this.props.loadDirentList(res.data.parent_dir);
|
||||
}).catch(error => {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onItemDownload = (e) => {
|
||||
e.preventDefault();
|
||||
@@ -451,27 +451,27 @@ class DirentListItem extends React.Component {
|
||||
let url = URLDecorator.getUrl({type: 'download_file_url', repoID: repoID, filePath: direntPath});
|
||||
location.href = url;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
closeZipDialog = () => {
|
||||
this.setState({
|
||||
isZipDialogOpen: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
getDirentPath = (dirent) => {
|
||||
let path = this.props.path;
|
||||
return path === '/' ? path + dirent.name : path + '/' + dirent.name;
|
||||
}
|
||||
};
|
||||
|
||||
onTagTooltipToggle = (e) => {
|
||||
e.stopPropagation();
|
||||
this.setState({isShowTagTooltip: !this.state.isShowTagTooltip});
|
||||
}
|
||||
};
|
||||
|
||||
onItemMove = (destRepo, dirent, selectedPath, currentPath) => {
|
||||
this.props.onItemMove(destRepo, dirent, selectedPath, currentPath);
|
||||
}
|
||||
};
|
||||
|
||||
onItemDragStart = (e) => {
|
||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
||||
@@ -501,7 +501,7 @@ class DirentListItem extends React.Component {
|
||||
dragStartItemData = JSON.stringify(dragStartItemData);
|
||||
|
||||
e.dataTransfer.setData('applicaiton/drag-item-info', dragStartItemData);
|
||||
}
|
||||
};
|
||||
|
||||
onItemDragEnter = (e) => {
|
||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
||||
@@ -511,7 +511,7 @@ class DirentListItem extends React.Component {
|
||||
e.stopPropagation();
|
||||
this.setState({isDropTipshow: true});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onItemDragOver = (e) => {
|
||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
||||
@@ -522,7 +522,7 @@ class DirentListItem extends React.Component {
|
||||
}
|
||||
e.preventDefault();
|
||||
e.dataTransfer.dropEffect = 'move';
|
||||
}
|
||||
};
|
||||
|
||||
onItemDragLeave = (e) => {
|
||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
||||
@@ -533,7 +533,7 @@ class DirentListItem extends React.Component {
|
||||
e.stopPropagation();
|
||||
}
|
||||
this.setState({isDropTipshow: false});
|
||||
}
|
||||
};
|
||||
|
||||
onItemDragDrop = (e) => {
|
||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
||||
@@ -583,16 +583,16 @@ class DirentListItem extends React.Component {
|
||||
|
||||
let selectedPath = Utils.joinPath(this.props.path, this.props.dirent.name);
|
||||
this.onItemMove(this.props.currentRepoInfo, nodeDirent, selectedPath, nodeParentPath);
|
||||
}
|
||||
};
|
||||
|
||||
onItemMouseDown = (event) => {
|
||||
this.props.onItemMouseDown(event);
|
||||
}
|
||||
};
|
||||
|
||||
onItemContextMenu = (event) => {
|
||||
let dirent = this.props.dirent;
|
||||
this.props.onItemContextMenu(event, dirent);
|
||||
}
|
||||
};
|
||||
|
||||
renderItemOperation = () => {
|
||||
let { dirent, currentRepoInfo, selectedDirentList } = this.props;
|
||||
@@ -662,7 +662,7 @@ class DirentListItem extends React.Component {
|
||||
}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
let { path, dirent, activeDirent } = this.props;
|
||||
@@ -735,7 +735,7 @@ class DirentListItem extends React.Component {
|
||||
{this.state.isRenameing && <Rename hasSuffix={dirent.type !== 'dir'} name={dirent.name} onRenameConfirm={this.onRenameConfirm} onRenameCancel={this.onRenameCancel} />}
|
||||
{!this.state.isRenameing && (
|
||||
<Fragment>
|
||||
{(!dirent.isDir() && !this.canPreview) ?
|
||||
{(!dirent.isDir() && !this.canPreview) ?
|
||||
<a className="sf-link" onClick={this.onItemClick}>{dirent.name}</a> :
|
||||
<a href={dirent.type === 'dir' ? dirHref : fileHref} onClick={this.onItemClick}>{dirent.name}</a>
|
||||
}
|
||||
|
@@ -49,6 +49,9 @@ const propTypes = {
|
||||
userPerm: PropTypes.string,
|
||||
showDirentDetail: PropTypes.func.isRequired,
|
||||
loadDirentList: PropTypes.func,
|
||||
fullDirentList: PropTypes.array,
|
||||
posX: PropTypes.string,
|
||||
posY: PropTypes.string,
|
||||
};
|
||||
|
||||
class DirentListView extends React.Component {
|
||||
@@ -95,11 +98,11 @@ class DirentListView extends React.Component {
|
||||
|
||||
freezeItem = () => {
|
||||
this.setState({isItemFreezed: true});
|
||||
}
|
||||
};
|
||||
|
||||
unfreezeItem = () => {
|
||||
this.setState({isItemFreezed: false});
|
||||
}
|
||||
};
|
||||
|
||||
onItemRename = (dirent, newName) => {
|
||||
let isDuplicated = this.props.direntList.some(item => {
|
||||
@@ -112,16 +115,16 @@ class DirentListView extends React.Component {
|
||||
return false;
|
||||
}
|
||||
this.props.onItemRename(dirent, newName);
|
||||
}
|
||||
};
|
||||
|
||||
onItemRenameToggle = () => {
|
||||
this.freezeItem();
|
||||
}
|
||||
};
|
||||
|
||||
onItemSelected = (dirent) => {
|
||||
this.setState({activeDirent: null});
|
||||
this.props.onItemSelected(dirent);
|
||||
}
|
||||
};
|
||||
|
||||
onDirentClick = (dirent) => {
|
||||
hideMenu();
|
||||
@@ -130,28 +133,28 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
this.setState({activeDirent: dirent});
|
||||
this.props.onDirentClick(dirent);
|
||||
}
|
||||
};
|
||||
|
||||
sortByName = (e) => {
|
||||
e.preventDefault();
|
||||
const sortBy = 'name';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortItems(sortBy, sortOrder);
|
||||
}
|
||||
};
|
||||
|
||||
sortByTime = (e) => {
|
||||
e.preventDefault();
|
||||
const sortBy = 'time';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortItems(sortBy, sortOrder);
|
||||
}
|
||||
};
|
||||
|
||||
sortBySize = (e) => {
|
||||
e.preventDefault();
|
||||
const sortBy = 'size';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortItems(sortBy, sortOrder);
|
||||
}
|
||||
};
|
||||
|
||||
// for image popup
|
||||
prepareImageItem = (item) => {
|
||||
@@ -165,7 +168,7 @@ class DirentListView extends React.Component {
|
||||
'url': `${siteRoot}lib/${repoID}/file${path}`,
|
||||
'src': src
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
showImagePopup = (curItem) => {
|
||||
let items = this.props.fullDirentList.filter((item) => {
|
||||
@@ -181,38 +184,38 @@ class DirentListView extends React.Component {
|
||||
imageItems: imageItems,
|
||||
imageIndex: items.indexOf(curItem)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
moveToPrevImage = () => {
|
||||
const imageItemsLength = this.state.imageItems.length;
|
||||
this.setState((prevState) => ({
|
||||
imageIndex: (prevState.imageIndex + imageItemsLength - 1) % imageItemsLength
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
moveToNextImage = () => {
|
||||
const imageItemsLength = this.state.imageItems.length;
|
||||
this.setState((prevState) => ({
|
||||
imageIndex: (prevState.imageIndex + 1) % imageItemsLength
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
closeImagePopup = () => {
|
||||
this.setState({isImagePopupOpen: false});
|
||||
}
|
||||
};
|
||||
|
||||
onCreateFileToggle = () => {
|
||||
this.setState({isCreateFileDialogShow: !this.state.isCreateFileDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onCreateFolderToggle = () => {
|
||||
this.setState({isCreateFolderDialogShow: !this.state.isCreateFolderDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onAddFolder = (dirPath) => {
|
||||
this.setState({isCreateFolderDialogShow: false});
|
||||
this.props.onAddFolder(dirPath);
|
||||
}
|
||||
};
|
||||
|
||||
checkDuplicatedName = (newName) => {
|
||||
let direntList = this.props.direntList;
|
||||
@@ -220,15 +223,15 @@ class DirentListView extends React.Component {
|
||||
return object.name === newName;
|
||||
});
|
||||
return isDuplicated;
|
||||
}
|
||||
};
|
||||
|
||||
onMoveToggle = () => {
|
||||
this.setState({isMoveDialogShow: !this.state.isMoveDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onCopyToggle = () => {
|
||||
this.setState({isCopyDialogShow: !this.state.isCopyDialogShow});
|
||||
}
|
||||
};
|
||||
|
||||
onItemsDownload = () => {
|
||||
let { path, repoID, selectedDirentList } = this.props;
|
||||
@@ -249,11 +252,11 @@ class DirentListView extends React.Component {
|
||||
downloadItems: selectedDirentNames
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onCloseZipDownloadDialog = () => {
|
||||
this.setState({isProgressDialogShow: false});
|
||||
}
|
||||
};
|
||||
|
||||
// common contextmenu handle
|
||||
onMouseDown = (event) => {
|
||||
@@ -261,7 +264,7 @@ class DirentListView extends React.Component {
|
||||
if (event.button === 2) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleContextClick = (event, id, menuList, currentObject = null) => {
|
||||
event.preventDefault();
|
||||
@@ -292,7 +295,7 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
|
||||
showMenu(showMenuConfig);
|
||||
}
|
||||
};
|
||||
|
||||
// table-container contextmenu handle
|
||||
onContainerClick = () => {
|
||||
@@ -300,11 +303,11 @@ class DirentListView extends React.Component {
|
||||
if (this.state.activeDirent) {
|
||||
this.onDirentClick(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onContainerMouseDown = (event) => {
|
||||
this.onMouseDown(event);
|
||||
}
|
||||
};
|
||||
|
||||
onContainerContextMenu = (event) => {
|
||||
event.preventDefault();
|
||||
@@ -367,7 +370,7 @@ class DirentListView extends React.Component {
|
||||
this.handleContextClick(event, id, menuList);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onContainerMenuItemClick = (operation) => {
|
||||
switch(operation) {
|
||||
@@ -382,7 +385,7 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
|
||||
hideMenu();
|
||||
}
|
||||
};
|
||||
|
||||
onDirentsMenuItemClick = (operation) => {
|
||||
switch(operation) {
|
||||
@@ -403,21 +406,21 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
|
||||
hideMenu();
|
||||
}
|
||||
};
|
||||
|
||||
// table-thread contextmenu handle -- Shield event
|
||||
onThreadMouseDown = (event) => {
|
||||
this.onMouseDown(event);
|
||||
}
|
||||
};
|
||||
|
||||
onThreadContextMenu = (event) => {
|
||||
event.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
// table-dirent-item contextmenu handle
|
||||
onItemMouseDown = (event) => {
|
||||
this.onMouseDown(event);
|
||||
}
|
||||
};
|
||||
|
||||
onItemContextMenu = (event, dirent) => {
|
||||
// Display menu items according to the current dirent permission
|
||||
@@ -428,26 +431,26 @@ class DirentListView extends React.Component {
|
||||
let id = 'dirent-item-menu';
|
||||
let menuList = this.getDirentItemMenuList(dirent, true);
|
||||
this.handleContextClick(event, id, menuList, dirent);
|
||||
}
|
||||
};
|
||||
|
||||
setDirentItemRef = (index) => item => {
|
||||
this.direntItems[index] = item;
|
||||
}
|
||||
};
|
||||
|
||||
onMenuItemClick = (operation, currentObject, event) => {
|
||||
let index = this.getDirentIndex(currentObject);
|
||||
this.direntItems[index].onMenuItemClick(operation, event);
|
||||
|
||||
hideMenu();
|
||||
}
|
||||
};
|
||||
|
||||
onShowMenu = (e) => {
|
||||
this.freezeItem();
|
||||
}
|
||||
};
|
||||
|
||||
onHideMenu = (e) => {
|
||||
this.unfreezeItem();
|
||||
}
|
||||
};
|
||||
|
||||
// contextmenu utils
|
||||
getDirentIndex = (dirent) => {
|
||||
@@ -460,13 +463,13 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
};
|
||||
|
||||
getDirentItemMenuList = (dirent, isContextmenu) => {
|
||||
const isRepoOwner = this.isRepoOwner;
|
||||
const currentRepoInfo = this.props.currentRepoInfo;
|
||||
return Utils.getDirentOperationList(isRepoOwner, currentRepoInfo, dirent, isContextmenu);
|
||||
}
|
||||
};
|
||||
|
||||
onTableDragEnter = (e) => {
|
||||
if (Utils.isIEBrower() || !this.canDrop) {
|
||||
@@ -479,7 +482,7 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
this.setState({isListDropTipShow: true});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onTableDragOver = (e) => {
|
||||
if (Utils.isIEBrower() || !this.canDrop) {
|
||||
@@ -490,7 +493,7 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
e.preventDefault();
|
||||
e.dataTransfer.dropEffect = 'move';
|
||||
}
|
||||
};
|
||||
|
||||
onTableDragLeave = (e) => {
|
||||
if (Utils.isIEBrower() || !this.canDrop) {
|
||||
@@ -500,7 +503,7 @@ class DirentListView extends React.Component {
|
||||
if (this.enteredCounter === 0) {
|
||||
this.setState({isListDropTipShow: false});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
tableDrop = (e) => {
|
||||
if (Utils.isIEBrower() || !this.canDrop) {
|
||||
@@ -530,19 +533,19 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
|
||||
this.props.onItemMove(this.props.currentRepoInfo, nodeDirent, this.props.path, nodeParentPath);
|
||||
}
|
||||
};
|
||||
|
||||
onShowDirentsDraggablePreview = () => {
|
||||
this.setState({
|
||||
isShowDirentsDraggablePreview: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onHideDirentsDraggablePreview = () => {
|
||||
this.setState({
|
||||
isShowDirentsDraggablePreview: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { direntList, sortBy, sortOrder } = this.props;
|
||||
|
@@ -28,18 +28,18 @@ class DirentNodeView extends React.Component {
|
||||
fileType: type,
|
||||
isCreateFileDialogShow: !this.state.isCreateFileDialogShow,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onCreateFileToggle = () => {
|
||||
this.setState({
|
||||
fileType: '',
|
||||
isCreateFileDialogShow: !this.state.isCreateFileDialogShow,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
checkDuplicatedName = () => {
|
||||
return false; // current repo is null, and unnecessary to check duplicated name
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
if (this.props.isDirentListLoading) {
|
||||
|
Reference in New Issue
Block a user