diff --git a/src/view.ts b/src/view.ts index 7151f85..acf467e 100644 --- a/src/view.ts +++ b/src/view.ts @@ -31,8 +31,10 @@ export class JSPView extends ItemView { .setClass("clickable-icon") .setTooltip("Open in Obsidian") .setIcon("edit") - .onClick(async () => { - // TODO open in obsidian + .onClick(async e => { + let leaf = this.app.workspace.getLeaf(e.ctrlKey); + await leaf.openFile(file); + this.app.workspace.setActiveLeaf(leaf, {focus: true}); }); new ButtonComponent(div) .setClass("clickable-icon") diff --git a/test-vault/.obsidian/plugins/just-share-please/data.json b/test-vault/.obsidian/plugins/just-share-please/data.json index 0d5b691..1d9d758 100644 --- a/test-vault/.obsidian/plugins/just-share-please/data.json +++ b/test-vault/.obsidian/plugins/just-share-please/data.json @@ -1,6 +1,12 @@ { "url": "http://localhost:8080", - "shared": [], + "shared": [ + { + "id": "6ba272db", + "password": "6bf48896857373ff766f44052cbc8c38", + "path": "Cool Test Note.md" + } + ], "stripFrontmatter": true, "includeNoteName": true } \ No newline at end of file