aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/KeyValueBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <35748010+samwilkins333@users.noreply.github.com>2019-06-27 12:39:36 -0400
committerGitHub <noreply@github.com>2019-06-27 12:39:36 -0400
commit5b2ee61fd04f18478e3b5355ae19cd06a0840fa5 (patch)
tree26e5cb1c35ef9f8e9bbec0aa3799b3ff5cd4bc75 /src/client/views/nodes/KeyValueBox.tsx
parent775885384e6032dbb8f0d37b569854a0692a4b45 (diff)
templating workflow improvements
Diffstat (limited to 'src/client/views/nodes/KeyValueBox.tsx')
-rw-r--r--src/client/views/nodes/KeyValueBox.tsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/nodes/KeyValueBox.tsx b/src/client/views/nodes/KeyValueBox.tsx
index 4beb70284..af22f0a48 100644
--- a/src/client/views/nodes/KeyValueBox.tsx
+++ b/src/client/views/nodes/KeyValueBox.tsx
@@ -145,7 +145,9 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
}
getTemplate = async () => {
- let parent = Docs.FreeformDocument([], { width: 800, height: 800, title: "Template" });
+ let parent = Docs.StackingDocument([], { width: 800, height: 800, title: "Template" });
+ parent.singleColumn = false;
+ parent.columnWidth = 50;
for (let row of this.rows.filter(row => row.isChecked)) {
await this.createTemplateField(parent, row);
row.uncheck();
@@ -167,8 +169,8 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
let template = Doc.MakeAlias(target);
template.proto = parent;
template.title = metaKey;
- template.nativeWidth = 300;
- template.nativeHeight = 300;
+ template.nativeWidth = 0;
+ template.nativeHeight = 0;
template.embed = true;
template.isTemplate = true;
template.templates = new List<string>([Templates.TitleBar(metaKey)]);
@@ -187,7 +189,7 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
inferType = (field: FieldResult, metaKey: string) => {
let options = { width: 300, height: 300, title: metaKey };
if (field instanceof RichTextField || typeof field === "string" || typeof field === "number") {
- return Docs.TextDocument(options);
+ return Docs.StackingDocument(options);
} else if (field instanceof List) {
return Docs.FreeformDocument([], options);
} else if (field instanceof ImageField) {
@@ -218,4 +220,4 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
{dividerDragger}
</div>);
}
-} \ No newline at end of file
+}