diff --git a/ftl/core/editing.ftl b/ftl/core/editing.ftl index 6e4d9086a..32e5a6b16 100644 --- a/ftl/core/editing.ftl +++ b/ftl/core/editing.ftl @@ -54,7 +54,8 @@ editing-text-highlight-color = Text highlight color editing-to-make-a-cloze-deletion-on = To make a cloze deletion on an existing note, you need to change it to a cloze type first, via 'Notes>Change Note Type' editing-toggle-html-editor = Toggle HTML Editor editing-toggle-sticky = Toggle sticky -editing-toggle-visual-editor = Toggle Visual Editor +editing-expand-field = Expand field +editing-collapse-field = Collapse field editing-underline-text = Underline text editing-unordered-list = Unordered list editing-warning-cloze-deletions-will-not-work = Warning, cloze deletions will not work until you switch the type at the top to Cloze. diff --git a/ts/editor/EditorField.svelte b/ts/editor/EditorField.svelte index 262f73027..28f78c816 100644 --- a/ts/editor/EditorField.svelte +++ b/ts/editor/EditorField.svelte @@ -44,13 +44,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import type { Writable } from "svelte/store"; import { writable } from "svelte/store"; - import { descriptionKey, directionKey } from "../lib/context-keys"; + import { collapsedKey, descriptionKey, directionKey } from "../lib/context-keys"; import { promiseWithResolver } from "../lib/promise"; import type { Destroyable } from "./destroyable"; import EditingArea from "./EditingArea.svelte"; export let content: Writable; export let field: FieldData; + export let collapsed = false; const directionStore = writable<"ltr" | "rtl">(); setContext(directionKey, directionStore); @@ -62,6 +63,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $: $descriptionStore = field.description; + const collapsedStore = writable(); + setContext(collapsedKey, collapsedStore); + + $: $collapsedStore = collapsed; + const editingArea: Partial = {}; const [element, elementResolve] = promiseWithResolver(); @@ -89,14 +95,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html > - - - + {#if !collapsed} + + + + {/if}