aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-01 13:49:09 -0400
committerbobzel <zzzman@gmail.com>2025-04-01 13:49:09 -0400
commit6187b0691299f92f526b65bd6ad4a5148b387607 (patch)
tree97f0433649c29959d268f0a394029024f5c1173c /src/client/views
parent6c8effb77029db96bccab92152a6b68a0aefc132 (diff)
added an override_backgroundColor or templates that want to control background colors. needs to be generalized, perhaps along the lines of !important. fixed script sto ignore Array<T> template errors..
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/StyleProvider.tsx3
-rw-r--r--src/client/views/nodes/ImageBox.tsx2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 432a05146..ae94c206c 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -252,7 +252,8 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps &
const usePath = StrCast(doc?.[dataKey + "_usePath"]);
const alternate = usePath.includes(":hover") ? ( isHovering?.() ? '_' + usePath.replace(":hover","") : "") : usePath ? "_" +usePath:usePath;
let docColor: Opt<string> = StrCast(doc?.[fieldKey+alternate], StrCast(doc?.['backgroundColor' +alternate], isCaption ? 'rgba(0,0,0,0.4)' : ''));
- if (!docColor && doc?.[StrCast(doc?.layout_fieldKey)] instanceof Doc) docColor = StrCast(doc._backgroundColor,docColor)
+ if (!docColor && doc?.[StrCast(doc?.layout_fieldKey)] instanceof Doc) docColor = StrCast(doc._backgroundColor,docColor);
+ if (docColor && doc?._override_backgroundColor) docColor = StrCast(doc._backgroundColor,docColor);
// prettier-ignore
switch (layoutDoc?.type) {
case DocumentType.PRESELEMENT: docColor = docColor || ""; break;
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index dc4b79983..f2eacb35c 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -746,8 +746,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
TraceMobx();
const borderRad = this._props.styleProvider?.(this.layoutDoc, this._props, StyleProp.BorderRounding) as string;
const borderRadius = borderRad?.includes('px') ? `${Number(borderRad.split('px')[0]) / (this._props.NativeDimScaling?.() || 1)}px` : borderRad;
- const alts = DocListCast(this.dataDoc[this.fieldKey + '_alternates']);
- const doc = this.usingAlternate ? (alts.lastElement() ?? this.Document) : this.Document;
return (
<div
className="imageBox"