diff --git a/frontend/src/components/dialog/wiki-select-dialog.js b/frontend/src/components/dialog/wiki-select-dialog.js
index 1959a4029e..bccc0b5bb0 100644
--- a/frontend/src/components/dialog/wiki-select-dialog.js
+++ b/frontend/src/components/dialog/wiki-select-dialog.js
@@ -68,7 +68,7 @@ class WikiSelectDialog extends React.Component {
return (
}
{dirent.is_locked &&
}
+
diff --git a/frontend/src/components/dirent-list-view/dirent-list-view.js b/frontend/src/components/dirent-list-view/dirent-list-view.js
index fc1cb5f2f9..d5eb438139 100644
--- a/frontend/src/components/dirent-list-view/dirent-list-view.js
+++ b/frontend/src/components/dirent-list-view/dirent-list-view.js
@@ -17,6 +17,7 @@ import CopyDirentDialog from '../dialog/copy-dirent-dialog';
import DirentListItem from './dirent-list-item';
import ContextMenu from '../context-menu/context-menu';
import { hideMenu, showMenu } from '../context-menu/actions';
+import DirentsDraggedPreview from '../draggable/dirents-dragged-preview';
const propTypes = {
path: PropTypes.string.isRequired,
@@ -69,6 +70,7 @@ class DirentListView extends React.Component {
isMutipleOperation: true,
activeDirent: null,
isListDropTipShow: false,
+ isShowDirentsDraggablePreview: false,
};
this.enteredCounter = 0; // Determine whether to enter the child element to avoid dragging bubbling bugs。
@@ -567,6 +569,9 @@ class DirentListView extends React.Component {
}
this.enteredCounter++;
if (this.enteredCounter !== 0) {
+ if (this.state.isListDropTipShow) {
+ return ;
+ }
this.setState({isListDropTipShow: true});
}
}
@@ -619,6 +624,18 @@ 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;
@@ -694,6 +711,7 @@ class DirentListView extends React.Component {
getDirentItemMenuList={this.getDirentItemMenuList}
showDirentDetail={this.props.showDirentDetail}
onItemsMove={this.props.onItemsMove}
+ onShowDirentsDraggablePreview={this.onShowDirentsDraggablePreview}
/>
);
})}
@@ -714,6 +732,15 @@ class DirentListView extends React.Component {
id={'dirents-menu'}
onMenuItemClick={this.onDirentsMenuItemClick}
/>
+ {this.state.isShowDirentsDraggablePreview &&
+
+
+
+ }
{this.state.isImagePopupOpen && (
{
+ this.element.style.opacity = 0;
+ this.props.onHideDirentsDraggablePreview();
+ }
+
+ handleDragOver = (event) => {
+ if (Utils.isIEBrower()) {
+ return false;
+ }
+ event.preventDefault();
+ event.dataTransfer.dropEffect = 'move';
+
+ this.element.style.top = event.clientY + 'px';
+ this.element.style.left = event.clientX + 'px';
+ }
+
+ handleDrop = (event) => {
+ this.element.style.opacity = 0;
+ this.props.onHideDirentsDraggablePreview();
+ }
+
+ render() {
+ let{ selectedDirentList } = this.props;
+ const inlineStyle = {
+ position: 'absolute',
+ opacity: 1,
+ pointerEvents: 'none',
+ display: 'block',
+ left: '-9999px',
+ top: '-9999px',
+ zIndex: 101,
+ maxHeight: document.documentElement.clientHeight,
+ overflow: 'hidden'
+ };
+ return (
+ this.element = element}>
+ {selectedDirentList.map((dirent, index) => {
+ let iconUrl = Utils.getDirentIcon(dirent);
+ return (
+
+ {dirent.encoded_thumbnail_src ?
+  :
+ 
+ }
+
+ );
+ })}
+
+ );
+ }
+}
+
+DirentsDraggedPreview.propTypes = propTypes;
+
+export default DirentsDraggedPreview;
diff --git a/frontend/src/i18n.js b/frontend/src/i18n.js
index 6d60035d02..40289fe618 100644
--- a/frontend/src/i18n.js
+++ b/frontend/src/i18n.js
@@ -1,7 +1,6 @@
import i18n from 'i18next';
import XHR from 'i18next-xhr-backend';
-
-let siteRoot = window.app.config.siteRoot;
+import { mediaUrl } from './utils/constants';
i18n
.use(XHR)
@@ -14,7 +13,7 @@ i18n
whitelist: ['en', 'zh-CN', 'fr', 'de', 'cs', 'es', 'es-AR', 'es-MX', 'ru'],
backend: {
- loadPath: siteRoot + 'media/assets/frontend/locales/{{ lng }}/{{ ns }}.json',
+ loadPath: mediaUrl + 'assets/frontend/locales/{{ lng }}/{{ ns }}.json',
// loadPath: '/media/locales/{{lng}}/{{ns}}.json',
},
|