aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-09-14 00:33:18 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-09-14 00:33:18 -0400
commitd9fa64c229b13f9c8121a40b76d180775be5f6c6 (patch)
treee37608e0177d66c17134eeb75e7599f287ec68bf /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parent8a4163eedcfd37a5e245c710ffc674c1d16088f8 (diff)
fixed color assignments for rule providers. no titles are shown when promoting to a custom layout
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 4a3e5039a..ad91eb007 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -875,6 +875,22 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
autoFormat = () => {
this.props.Document.isRuleProvider = !this.props.Document.isRuleProvider;
this.childDocs.map(child => child.heading = undefined);
+ this.childDocs.map(child => {
+ DocListCast(child.layout instanceof Doc ? child.layout.data : child.data).map(heading => {
+ let pair = Doc.GetLayoutDataDocPair(this.props.Document, this.props.DataDoc, this.props.fieldKey, heading);
+ let disp = (child.data_ext instanceof Doc) && pair.layout && (child.data_ext[`Layout[${pair.layout[Id]}]`] as Doc);
+ if (disp && NumCast(disp.heading) > 0) {
+ if (disp.backgroundColor !== disp.defaultBackgroundColor) {
+ Doc.GetProto(this.props.Document)["ruleColor_" + NumCast(disp.heading)] = disp.backgroundColor;
+ }
+ }
+ if (pair.layout && NumCast(pair.layout.heading) > 0) {
+ if (pair.layout.backgroundColor !== pair.layout.defaultBackgroundColor) {
+ Doc.GetProto(this.props.Document)["ruleColor_" + NumCast(pair.layout.heading)] = pair.layout.backgroundColor;
+ }
+ }
+ })
+ })
}
analyzeStrokes = async () => {