Minor improvement

- Use arrow up key on File widget to navigate to parent directory
- Application will trigger a "launched" event when opened
This commit is contained in:
DanyLE 2022-07-04 19:59:34 +02:00
parent f97a45be15
commit b2ce9ec978
4 changed files with 22 additions and 6 deletions

Binary file not shown.

View File

@ -1070,12 +1070,6 @@ namespace OS {
return reject(d); return reject(d);
} }
FileDialog.last_opened = path; FileDialog.last_opened = path;
if (!dir.isRoot()) {
const p = dir.parent();
p.filename = "[..]";
p.type = "dir";
d.result.unshift(p);
}
return resolve(d.result); return resolve(d.result);
}) })
.catch((e: Error): void => reject(__e(e))); .catch((e: Error): void => reject(__e(e)));
@ -1188,6 +1182,18 @@ namespace OS {
if (this.data && this.data.hidden) { if (this.data && this.data.hidden) {
return (fileview.showhidden = this.data.hidden); return (fileview.showhidden = this.data.hidden);
} }
$(this.scheme).on("keyup", (evt)=>{
if(evt.which === 38)
{
const currdir = fileview.path.asFileHandle();
if (currdir.isRoot()) {
return;
}
const p = currdir.parent();
return fileview.path = p.path;
}
});
} }
} }

View File

@ -128,6 +128,7 @@ namespace OS {
app.scheme.uify(app.observable, true); app.scheme.uify(app.observable, true);
app.main(); app.main();
app.show(); app.show();
app.observable.trigger("launched",undefined);
} }
/** /**

View File

@ -372,6 +372,15 @@ namespace OS {
} }
}); });
$(this.scheme).on("keyup", (evt)=>{ $(this.scheme).on("keyup", (evt)=>{
if(evt.which === 38)
{
if (this.currdir.isRoot()) {
return;
}
const p = this.currdir.parent();
this.favo.selected = -1;
return this.view.path = p.path;
}
if(!evt.ctrlKey) if(!evt.ctrlKey)
{ {
this.view.multiselect = false; this.view.multiselect = false;