aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-04-29 11:55:38 -0400
committerGitHub <noreply@github.com>2020-04-29 11:55:38 -0400
commita5b7e73784e3f03ca7677f1d1f00b9943b40f0ec (patch)
treebd9645f717946e76ae26bd6bc06bd5fbe78620bb /src/client/views/nodes
parent6b2896756c55727ed397c223187cb03fe8a51a59 (diff)
parentf78d614f99fed4555f7a1211e522e34efc19f809 (diff)
Merge pull request #355 from browngraphicslab/monika_animation
Monika animation
Diffstat (limited to 'src/client/views/nodes')
-rw-r--r--src/client/views/nodes/FieldView.tsx5
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index a3790d38b..0b9edbcd3 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -51,6 +51,11 @@ export interface FieldViewProps {
ContentScaling: () => number;
ChromeHeight?: () => number;
childLayoutTemplate?: () => Opt<Doc>;
+ // properties intended to be used from within layout strings (otherwise use the function equivalents that work more efficiently with React)
+ height?: number;
+ width?: number;
+ background?: string;
+ color?: string;
}
@observer
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 248b4f467..c4e387e5a 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1224,10 +1224,10 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
<div className={`formattedTextBox-cont`} ref={this._ref}
style={{
- height: this.layoutDoc._autoHeight && this.props.renderDepth ? "max-content" : `calc(100% - ${this.props.ChromeHeight?.() || 0}px`,
- background: StrCast(this.layoutDoc[this.props.fieldKey + "-backgroundColor"], this.props.hideOnLeave ? "rgba(0,0,0 ,0.4)" : ""),
+ height: this.props.height ? this.props.height : this.layoutDoc._autoHeight && this.props.renderDepth ? "max-content" : `calc(100% - ${this.props.ChromeHeight?.() || 0}px`,
+ background: this.props.background ? this.props.background : StrCast(this.layoutDoc[this.props.fieldKey + "-backgroundColor"], this.props.hideOnLeave ? "rgba(0,0,0 ,0.4)" : ""),
opacity: this.props.hideOnLeave ? (this._entered ? 1 : 0.1) : 1,
- color: StrCast(this.layoutDoc[this.props.fieldKey + "-color"], this.props.hideOnLeave ? "white" : "inherit"),
+ color: this.props.color ? this.props.color : StrCast(this.layoutDoc[this.props.fieldKey + "-color"], this.props.hideOnLeave ? "white" : "inherit"),
pointerEvents: interactive ? "none" : undefined,
fontSize: Cast(this.layoutDoc._fontSize, "number", null),
fontFamily: StrCast(this.layoutDoc._fontFamily, "inherit"),