fixes #125 now hitting return will make the folder for you

This commit is contained in:
Shane Harris
2021-08-12 12:28:16 +02:00
parent 3661e1fcb6
commit 0e679f5cbc
6 changed files with 27 additions and 19 deletions
+9 -2
View File
@@ -25,6 +25,7 @@ export class FilesComponent implements OnInit {
@ViewChild('filesModal', { static: false }) filesModal;
@ViewChild('fixedAction', { static: false }) fixedAction;
@ViewChild('downloadMediaModal', { static: false }) downloadMediaModal;
@ViewChild('mkDirModal', { static: true }) mkDirModal;
files: FileFolderListing[] = [];
selectedFiles: FileFolderListing[] = [];
filesToBeSaved: FileFolderListing[];
@@ -64,8 +65,8 @@ export class FilesComponent implements OnInit {
return this.statusService.showStatus('A folder already exists with that name!!', true);
} else {
await this.adbService.makeDirectory(this.appService.path.posix.join(this.currentPath, this.folderName)).then(r => {
this.open(this.appService.path.posix.join(this.currentPath, this.folderName));
this.folderName = '';
this.open(this.currentPath);
});
}
}
@@ -298,6 +299,12 @@ export class FilesComponent implements OnInit {
}
this.breadcrumbs.push({ path, name });
}
autoReturn(event, callback) {
if (event.keyCode === 13) {
callback();
this.mkDirModal.closeModal();
}
}
open(path: string) {
this.currentPath = path;
this.breadcrumbs = [];
@@ -323,7 +330,7 @@ export class FilesComponent implements OnInit {
});
}
openSaveLocation() {
this.appService.electron.remote.shell.openPath(this.adbService.savePath);
this.appService.electron.remote.shell.openItem(this.adbService.savePath);
}
async readdir(path: string) {
let dirContents: FileFolderListing[];