aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-09-09 17:26:27 -0400
committerbob <bcz@cs.brown.edu>2019-09-09 17:26:27 -0400
commit2d21fff15510d6eeb8975cc2459f69ca28d86d1d (patch)
tree28ad1b973a1392ba42a81828337df6fb53a83f67 /src/client/views/collections/collectionFreeForm
parent5941e6f9904b0285fa983248535bead284aa16eb (diff)
added stand-in spatial parser.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx13
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 2ec2b0671..f7c1bedbb 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -256,6 +256,19 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
private getLocalTransform = (): Transform => Transform.Identity().scale(1 / this.zoomScaling()).translate(this.panX(), this.panY());
private addLiveTextBox = (newBox: Doc) => {
FormattedTextBox.SelectOnLoad = newBox[Id];// track the new text box so we can give it a prop that tells it to focus itself when it's displayed
+ newBox.heading = 1;
+ for (let i = 0; i < this.childDocs.length; i++) {
+ if (this.childDocs[i].heading == 1) {
+ newBox.heading = 2;
+ }
+ }
+ let ruleProvider = Cast(this.props.Document.ruleProvider, Doc);
+ if (!(ruleProvider instanceof Doc)) ruleProvider = this.props.Document;
+ let col = StrCast(ruleProvider["ruleColor_" + NumCast(newBox.heading)]);
+ let round = StrCast(ruleProvider["ruleRounding_" + NumCast(newBox.heading)]);
+ round && (newBox.borderRounding = round);
+ col && (newBox.backgroundColor = col);
+ newBox.ruleProvider = ruleProvider;
this.addDocument(newBox, false);
}
private addDocument = (newBox: Doc, allowDuplicates: boolean) => {
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index 5015ee39a..100e6d817 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -329,6 +329,7 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
this.props.addLiveTextDocument(summary);
}
else {
+ newCollection.ruleProvider = this.props.container.props.Document;
this.props.addDocument(newCollection, false);
this.props.selectDocuments([newCollection]);
}