mirror of https://github.com/keeweb/keeweb.git
fix #1608: improved the "Show all file" checkbox behavior
This commit is contained in:
parent
759b92bfd6
commit
a1da5ceabe
|
@ -793,16 +793,12 @@ class OpenView extends View {
|
||||||
dir: true
|
dir: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const listView = new StorageFileListView({
|
const listView = new StorageFileListView({ files });
|
||||||
files,
|
|
||||||
showHiddenFiles: config && config.showHiddenFiles
|
|
||||||
});
|
|
||||||
listView.on('selected', (file) => {
|
listView.on('selected', (file) => {
|
||||||
if (file.dir) {
|
if (file.dir) {
|
||||||
this.listStorage(storage, {
|
this.listStorage(storage, {
|
||||||
dir: file.path,
|
dir: file.path,
|
||||||
prevDir: (config && config.dir) || '',
|
prevDir: (config && config.dir) || ''
|
||||||
showHiddenFiles: true
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.openStorageFile(storage, file);
|
this.openStorageFile(storage, file);
|
||||||
|
|
|
@ -14,7 +14,7 @@ class StorageFileListView extends View {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
super(model);
|
super(model);
|
||||||
this.allStorageFiles = {};
|
this.allStorageFiles = {};
|
||||||
this.showHiddenFiles = !!this.model.showHiddenFiles;
|
this.showHiddenFiles = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -27,13 +27,11 @@ class StorageFileListView extends View {
|
||||||
dir: file.dir
|
dir: file.dir
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const visibleFiles = files.filter((f) => !f.dir && f.kdbx);
|
const visibleFiles = files.filter((f) => f.dir || f.kdbx);
|
||||||
const canShowHiddenFiles = visibleFiles.length && files.length > visibleFiles.length;
|
const canShowHiddenFiles = visibleFiles.length && files.length > visibleFiles.length;
|
||||||
if (!this.showHiddenFiles) {
|
if (!this.showHiddenFiles) {
|
||||||
if (visibleFiles.length > 0) {
|
if (visibleFiles.length > 0) {
|
||||||
files = visibleFiles;
|
files = visibleFiles;
|
||||||
} else {
|
|
||||||
this.showHiddenFiles = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const density = files.length > 14 ? 3 : files.length > 7 ? 2 : 1;
|
const density = files.length > 14 ? 3 : files.length > 7 ? 2 : 1;
|
||||||
|
|
|
@ -2,6 +2,7 @@ Release notes
|
||||||
-------------
|
-------------
|
||||||
##### v1.16.0 (TBD)
|
##### v1.16.0 (TBD)
|
||||||
`-` fixed a performance issue in searching entries
|
`-` fixed a performance issue in searching entries
|
||||||
|
`*` improved the "Show all file" checkbox behavior
|
||||||
|
|
||||||
##### v1.15.7 (2020-09-12)
|
##### v1.15.7 (2020-09-12)
|
||||||
`-` fix #1564: broken auto-type on some Linux installations
|
`-` fix #1564: broken auto-type on some Linux installations
|
||||||
|
|
Loading…
Reference in New Issue