aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-09-12 05:21:29 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-09-12 05:21:29 -0400
commitcbb016dd4bec4ce1367314717adf85640ae51c93 (patch)
tree5ec6a588780eb5c5cc9c75619bd5656ee35d1a25 /src/client/views/collections/collectionFreeForm
parent6cff2800f0aa2069787ff43831d18898c851bf3b (diff)
sharing workflow supported
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 3377775db..85002e40f 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -947,18 +947,22 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
layoutItems.push({ description: "Jitter Rotation", event: action(() => this.props.Document.jitterRotation = 10), icon: "paint-brush" });
let noteItems: ContextMenuProps[] = [];
- let notes = DocListCast((CurrentUserUtils.UserDocument.noteTypes as Doc).data);
- notes.map((node, i) => noteItems.push({ description: (i + 1) + ": " + StrCast(node.title), event: () => this.createText(i), icon: "eye" }));
- layoutItems.push({ description: "Add Note ...", subitems: noteItems, icon: "eye" })
+ if (CurrentUserUtils.UserDocument) {
+ let notes = DocListCast((CurrentUserUtils.UserDocument.noteTypes as Doc).data);
+ notes.map((node, i) => noteItems.push({ description: (i + 1) + ": " + StrCast(node.title), event: () => this.createText(i), icon: "eye" }));
+ }
+ layoutItems.push({ description: "Add Note ...", subitems: noteItems, icon: "eye" });
ContextMenu.Instance.addItem({ description: "Freeform Options ...", subitems: layoutItems, icon: "eye" });
}
createText = (noteStyle: number) => {
let pt = this.getTransform().transformPoint(ContextMenu.Instance.pageX, ContextMenu.Instance.pageY);
- let notes = DocListCast((CurrentUserUtils.UserDocument.noteTypes as Doc).data);
- let text = Docs.Create.TextDocument({ width: 200, height: 100, x: pt[0], y: pt[1], autoHeight: true, title: StrCast(notes[noteStyle % notes.length].title) });
- text.layout = notes[noteStyle % notes.length];
- this.addLiveTextBox(text);
+ if (CurrentUserUtils.UserDocument) {
+ let notes = DocListCast((CurrentUserUtils.UserDocument.noteTypes as Doc).data);
+ let text = Docs.Create.TextDocument({ width: 200, height: 100, x: pt[0], y: pt[1], autoHeight: true, title: StrCast(notes[noteStyle % notes.length].title) });
+ text.layout = notes[noteStyle % notes.length];
+ this.addLiveTextBox(text);
+ }
}
private childViews = () => [