mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Svelte Editor hotfixes (#1436)
* Fix white on white text in light mode * Reflect rename to FieldsEditor in class name * Fix adjusting fields ending in an endless loop
This commit is contained in:
parent
ad2c17aced
commit
bf3adbc812
3 changed files with 12 additions and 5 deletions
|
@ -2,12 +2,12 @@
|
|||
Copyright: Ankitects Pty Ltd and contributors
|
||||
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
-->
|
||||
<div class="multi-root-editor">
|
||||
<div class="fields-editor">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.multi-root-editor {
|
||||
.fields-editor {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -83,7 +83,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
newStore.subscribe((value) => updateField(i, value));
|
||||
}
|
||||
|
||||
for (let i = fieldStores.length; i > newFieldNames.length; i++) {
|
||||
for (
|
||||
let i = fieldStores.length;
|
||||
i > newFieldNames.length;
|
||||
i = fieldStores.length
|
||||
) {
|
||||
fieldStores.pop();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
import SetContext from "./SetContext.svelte";
|
||||
import ContentEditable from "../editable/ContentEditable.svelte";
|
||||
|
||||
import { onMount, getAllContexts } from "svelte";
|
||||
import { onMount, getContext, getAllContexts } from "svelte";
|
||||
import {
|
||||
nodeIsElement,
|
||||
nodeContainsInlineContent,
|
||||
|
@ -48,6 +48,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
import { wrapInternal } from "../lib/wrap";
|
||||
import { nodeStore } from "../sveltelib/node-store";
|
||||
import type { DecoratedElement } from "../editable/decorated";
|
||||
import { nightModeKey } from "../components/context-keys";
|
||||
|
||||
export let hidden: boolean;
|
||||
|
||||
|
@ -222,10 +223,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
unsubscribeToEditingArea();
|
||||
};
|
||||
});
|
||||
|
||||
const nightMode = getContext<boolean>(nightModeKey);
|
||||
</script>
|
||||
|
||||
<RichTextStyles
|
||||
color="white"
|
||||
color={nightMode ? "white" : "black"}
|
||||
let:attachToShadow={attachStyles}
|
||||
let:promise={stylesPromise}
|
||||
let:stylesDidLoad
|
||||
|
|
Loading…
Reference in a new issue