Remove read-only mode
This commit is contained in:
@@ -57,15 +57,6 @@ functions:
|
||||
command:
|
||||
name: "Page: Delete"
|
||||
|
||||
editorLoad:
|
||||
path: "./editor.ts:editorLoad"
|
||||
events:
|
||||
- plugs:loaded
|
||||
toggleReadOnlyode:
|
||||
path: "./editor.ts:toggleReadOnlyMode"
|
||||
command:
|
||||
name: "Editor: Toggle Read Only Mode"
|
||||
|
||||
# Attachments
|
||||
attachmentQueryProvider:
|
||||
path: ./attachment.ts:attachmentQueryProvider
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
import { clientStore, editor } from "$sb/silverbullet-syscall/mod.ts";
|
||||
|
||||
export async function editorLoad() {
|
||||
const readOnlyMode = await clientStore.get("readOnlyMode");
|
||||
if (readOnlyMode) {
|
||||
await editor.enableReadOnlyMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
export async function toggleReadOnlyMode() {
|
||||
let readOnlyMode = await clientStore.get("readOnlyMode");
|
||||
readOnlyMode = !readOnlyMode;
|
||||
await editor.enableReadOnlyMode(readOnlyMode);
|
||||
await clientStore.set("readOnlyMode", readOnlyMode);
|
||||
}
|
||||
|
||||
// Run on "editor:init"
|
||||
export async function setEditorMode() {
|
||||
if (await clientStore.get("vimMode")) {
|
||||
|
||||
Reference in New Issue
Block a user