opening XML and CSV files using the Open button

This commit is contained in:
antelle 2021-03-19 18:56:36 +01:00
parent 879ba17760
commit 78642f1c9b
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 12 additions and 5 deletions

View File

@ -211,11 +211,17 @@ class OpenView extends View {
fileSelected(e) {
const file = e.target.files[0];
if (file) {
this.processFile(file, (success) => {
if (success && !file.path && this.reading === 'fileData') {
this.showLocalFileAlert();
}
});
if (this.model.settings.canImportCsv && /\.csv$/.test(file.name)) {
Events.emit('import-csv-requested', file);
} else if (this.model.settings.canImportXml && /\.xml$/.test(file.name)) {
this.setFile(file, null, this.showLocalFileAlert.bind(this));
} else {
this.processFile(file, (success) => {
if (success && !file.path && this.reading === 'fileData') {
this.showLocalFileAlert();
}
});
}
}
}

View File

@ -2,6 +2,7 @@ Release notes
-------------
##### v1.18.0 (TBD)
`-` legacy auto-type removed
`+` opening XML and CSV files using the Open button
##### v1.17.3 (2021-03-14)
`-` fix #1747: white screen in old Safari