suppression recusivite des checkbox
This commit is contained in:
		@@ -443,28 +443,15 @@ export default {
 | 
				
			|||||||
            this.isDroppable = true;
 | 
					            this.isDroppable = true;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        async moveListOfFiles(files) {
 | 
					        async moveListOfFiles(files) {
 | 
				
			||||||
            let listOfFolder = [];
 | 
					 | 
				
			||||||
            for (const file of files.children) {
 | 
					            for (const file of files.children) {
 | 
				
			||||||
                this.transferProgress += 100 / files.children.length;
 | 
					                this.transferProgress += 100 / files.children.length;
 | 
				
			||||||
                if (file.isDirectory) {
 | 
					                if (file.isDirectory) {
 | 
				
			||||||
                    //just create the folder
 | 
					                    await this.moveFilesOfFolder(file, file.parentPath + '/');
 | 
				
			||||||
                    await this.createFolder(file, file.parentPath + '/');
 | 
					 | 
				
			||||||
                    let parentPath = file.parentPath;
 | 
					 | 
				
			||||||
                    if(parentPath === ''){
 | 
					 | 
				
			||||||
                        listOfFolder.push(file.name);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else{
 | 
					 | 
				
			||||||
                        listOfFolder.push(file.parentPath + '/' + file.name);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    if (file.content && typeof file.content.arrayBuffer === 'function') {
 | 
					                    if (file.content && typeof file.content.arrayBuffer === 'function') {
 | 
				
			||||||
                        file.content = await file.content.arrayBuffer();
 | 
					                        file.content = await file.content.arrayBuffer();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    if (listOfFolder.includes(file.parentPath)) {
 | 
					                    await this.moveFileToTarget(file, '');
 | 
				
			||||||
                        await this.moveFileToTarget(file, file.parentPath + '/', file.name);
 | 
					 | 
				
			||||||
                    } else {
 | 
					 | 
				
			||||||
                        await this.moveFileToTarget(file, '');
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -240,18 +240,8 @@ export default {
 | 
				
			|||||||
        handleCheckboxChange(file, event) {
 | 
					        handleCheckboxChange(file, event) {
 | 
				
			||||||
            if (event.target.checked) {
 | 
					            if (event.target.checked) {
 | 
				
			||||||
                this.cocheFile(file);
 | 
					                this.cocheFile(file);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                // Si c'est un dossier, cocher récursivement tous les fichiers enfants
 | 
					 | 
				
			||||||
                if (file.isDirectory && file.children) {
 | 
					 | 
				
			||||||
                    this.cocheFilesRecursively(file.children);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                this.decocheFile(file);
 | 
					                this.decocheFile(file);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                // Si c'est un dossier, décocher récursivement tous les fichiers enfants
 | 
					 | 
				
			||||||
                if (file.isDirectory && file.children) {
 | 
					 | 
				
			||||||
                    this.decocheFilesRecursively(file.children);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        getFullPath(file) {
 | 
					        getFullPath(file) {
 | 
				
			||||||
@@ -269,22 +259,6 @@ export default {
 | 
				
			|||||||
        decocheFile(file) {
 | 
					        decocheFile(file) {
 | 
				
			||||||
            this.cochedFiles = this.cochedFiles.filter(f => this.getFullPath(f) !== this.getFullPath(file));
 | 
					            this.cochedFiles = this.cochedFiles.filter(f => this.getFullPath(f) !== this.getFullPath(file));
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        cocheFilesRecursively(files) {
 | 
					 | 
				
			||||||
            files.forEach(file => {
 | 
					 | 
				
			||||||
                this.cocheFile(file);
 | 
					 | 
				
			||||||
                if (file.isDirectory && file.children) {
 | 
					 | 
				
			||||||
                    this.cocheFilesRecursively(file.children);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        decocheFilesRecursively(files) {
 | 
					 | 
				
			||||||
            files.forEach(file => {
 | 
					 | 
				
			||||||
                this.decocheFile(file);
 | 
					 | 
				
			||||||
                if (file.isDirectory && file.children) {
 | 
					 | 
				
			||||||
                    this.decocheFilesRecursively(file.children);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        isChecked(file) {
 | 
					        isChecked(file) {
 | 
				
			||||||
            return this.cochedFiles.some(f => this.getFullPath(f) === this.getFullPath(file));
 | 
					            return this.cochedFiles.some(f => this.getFullPath(f) === this.getFullPath(file));
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user