Improve editor, plugin updates, and window transfers for 0.1.41
This commit is contained in:
@@ -702,14 +702,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function createTreeNote(parent: string, template?: NoteTemplate) {
|
||||
try {
|
||||
const path = await createNote(parent, template);
|
||||
await load(parent);
|
||||
onCreated?.({ name: path.split("/").pop()!, rel_path: path, kind: "file" });
|
||||
} catch (reason) { error = String(reason); }
|
||||
}
|
||||
|
||||
function paneMenuItems(parent: string): MenuItem[] {
|
||||
const fromTemplate = async (template?: NoteTemplate) => {
|
||||
try {
|
||||
const path = await createNote(parent, template);
|
||||
await load(parent);
|
||||
onCreated?.({ name: path.split("/").pop()!, rel_path: path, kind: "file" });
|
||||
} catch (reason) { error = String(reason); }
|
||||
};
|
||||
const fromTemplate = (template?: NoteTemplate) => createTreeNote(parent, template);
|
||||
return [
|
||||
{
|
||||
kind: "action",
|
||||
@@ -881,7 +883,7 @@
|
||||
|
||||
<div class="wrap">
|
||||
<div class="ribbon tree-tools">
|
||||
<IconButton icon="file-plus" label={$t("New file")} onclick={() => void createIn("", "file")} />
|
||||
<IconButton icon="file-plus" label={$t("New note")} onclick={() => void createTreeNote("")} />
|
||||
<IconButton icon="folder-plus" label={$t("New folder")} onclick={() => void createIn("", "folder")} />
|
||||
<IconButton
|
||||
icon="sort"
|
||||
|
||||
Reference in New Issue
Block a user