Cmd/Ctrl-click now opens page in new window

This commit is contained in:
Zef Hemel
2022-10-29 09:23:12 +02:00
parent 540af411a0
commit bef2c4c62b
4 changed files with 26 additions and 8 deletions
+14 -1
View File
@@ -604,10 +604,23 @@ export class Editor {
this.editorView!.focus();
}
async navigate(name: string, pos?: number | string, replaceState = false) {
async navigate(
name: string,
pos?: number | string,
replaceState = false,
newWindow = false,
) {
if (!name) {
name = this.indexPage;
}
if (newWindow) {
const win = window.open(`${location.origin}/${name}`, "_blank");
if (win) {
win.focus();
}
return;
}
await this.pageNavigator.navigate(name, pos, replaceState);
}