diff --git a/src/components/FileTable.vue b/src/components/FileTable.vue index 0eb7bd3..1e4abba 100644 --- a/src/components/FileTable.vue +++ b/src/components/FileTable.vue @@ -6,15 +6,13 @@ - + @@ -111,6 +107,7 @@ import { getClient, getRootPath } from '@nextcloud/files/dav'; import NcBreadcrumbs from '@nextcloud/vue/dist/Components/NcBreadcrumbs.js'; import NcBreadcrumb from '@nextcloud/vue/dist/Components/NcBreadcrumb.js'; import Plus from 'vue-material-design-icons/Plus.vue' +import { ref } from 'vue'; export default { name: 'FileTable', @@ -121,8 +118,8 @@ export default { }, props: { file: { - type: Object, - default: null, + type: Object, + default: null, }, }, data() { @@ -134,6 +131,7 @@ export default { isAddFilePopupVisible: false, newFileName: '', isTransfering: false, + isDragging: ref(false), }; }, async mounted() { @@ -166,6 +164,12 @@ export default { const parts = this.breadcrumbParts.slice(0, index + 1); return '/' + parts.join('/'); }, + enterDrag() { + this.isDragging = true; + }, + leaveDrag() { + this.isDragging = false; + }, getBreadcrumbParts() { // Si le current_dir est un simple '/', on le renvoie sous forme de tableau vide. if (this.current_dir === '/') return []; @@ -210,7 +214,7 @@ export default { }, async onDrop(event) { event.preventDefault(); - + try { const moveFilesOfFolder = async (folder) => { diff --git a/src/components/WebContentViewer.vue b/src/components/WebContentViewer.vue index 3ddfe09..fbf09e7 100644 --- a/src/components/WebContentViewer.vue +++ b/src/components/WebContentViewer.vue @@ -175,7 +175,7 @@ export default { content: isDirectory ? null : '', // Initialiser 'content' pour les fichiers children: isDirectory ? [] : null, //remove the name of the file from the path - parentPath: pathParts.slice(0, i).join('/'), + parentPath: i > 0 ? pathParts[i - 1] : '', unzip: promise }; currentLevel.push(existing); @@ -220,7 +220,6 @@ export default { this.$set(this.folderMap, file.fullPath, !currentState); }, async onDragStart(file) { - console.log('Drag start', file); const getFilesFromFolder = (folder) => { const files = []; @@ -256,4 +255,4 @@ export default { + \ No newline at end of file