aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/StyleProvider.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-10 16:34:37 -0400
committerbobzel <zzzman@gmail.com>2024-05-10 16:34:37 -0400
commitdc20525c09943fef332f8e7dac54aab3039e8df7 (patch)
treeeda5a2fe066e1be498c7789756088a30f8d0c0e6 /src/client/views/StyleProvider.tsx
parent4b4d77f99bd55e6de0593c3acd1cf5798ae038bf (diff)
fixed exception when text templates have no inherited data, and when text views are modified after the editor has been destroyed. random code cleanup
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r--src/client/views/StyleProvider.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 0b8201903..3842f930a 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -80,8 +80,8 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps &
const isNonTransparentLevel = isNonTransparent ? Number(property.replace(/.*:nonTransparent([0-9]+).*/, '$1')) : 0; // property.includes(':nonTransparent');
const isAnnotated = property.includes(':annotated');
const layoutDoc = doc ? Doc.Layout(doc) : doc;
- const isOpen = property.includes(':open');
- const boxBackground = property.includes(':box');
+ const isOpen = property.includes(':treeOpen');
+ const boxBackground = property.includes(':docView'); // background color of docView's bounds can be different than the background of contents -- eg FontIconBox
const {
DocumentView: docView,
fieldKey: fieldKeyProp,
@@ -115,7 +115,7 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps &
// prettier-ignore
switch (property.split(':')[0]) {
case StyleProp.TreeViewIcon: {
- const img = ImageCast(doc?.icon, ImageCast(doc?.data));
+ const img = ImageCast(doc?.icon ?? doc?.[doc ? Doc.LayoutFieldKey(doc) : ""]);
if (img) {
const ext = extname(img.url.href);
const url = doc?.icon ? img.url.href : img.url.href.replace(ext, '_s' + ext);