add copy path button to file browser #143

This commit is contained in:
Max Myers
2021-10-19 15:36:29 -04:00
parent cfcf2f0890
commit aa862101f0
2 changed files with 9 additions and 3 deletions
@@ -29,6 +29,8 @@
<div class="right"> <div class="right">
<span *ngIf="file.icon !== 'folder'">{{file.size|number:'1.2-2'}}MB | </span>{{file.time|date:'short'}} <span *ngIf="file.icon !== 'folder'">{{file.size|number:'1.2-2'}}MB | </span>{{file.time|date:'short'}}
<i class="material-icons cursor white-text drag-indicator save-icon"
title="Copy full file path to the clipboard" (click)="copyPathToClipboard(file.filePath)">content_copy</i>
<i class="material-icons cursor white-text drag-indicator save-icon" <i class="material-icons cursor white-text drag-indicator save-icon"
(click)="filesToBeSaved = [file]; filesModal.openModal();">save</i> (click)="filesToBeSaved = [file]; filesModal.openModal();">save</i>
<i class="material-icons cursor orange-text drag-indicator right delete" <i class="material-icons cursor orange-text drag-indicator right delete"
@@ -110,6 +110,10 @@ export class FilesComponent implements OnInit {
this.selectedFiles.length = 0; this.selectedFiles.length = 0;
} }
} }
copyPathToClipboard(path = null) {
this.appService.electron.clipboard.writeText(path || this.currentPath);
this.statusService.showStatus(`Copied file path to your clipboard!`);
}
async uploadFolder(folder, files, task) { async uploadFolder(folder, files, task) {
task.status = 'Restoring Folder... ' + folder; task.status = 'Restoring Folder... ' + folder;
if (this.appService.fs.existsSync(folder)) { if (this.appService.fs.existsSync(folder)) {