aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-04-23 20:52:09 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-04-23 20:52:09 -0400
commita37559a417b8a19ee56ac3b2f5dd46ef70ca53a6 (patch)
tree4a022fce15d64724214dc327cc67b8c361cd663f /src/new_fields/Doc.ts
parent8a8f2c8848fe76e26188666790accaf236267e78 (diff)
fixed loading of notes with template types. changed noteTypes to ["template-notes"]. Added pass through free form layout engine.
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r--src/new_fields/Doc.ts18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 5f790f886..1373431b8 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -14,7 +14,7 @@ import { PrefetchProxy, ProxyField } from "./Proxy";
import { FieldId, RefField } from "./RefField";
import { RichTextField } from "./RichTextField";
import { listSpec } from "./Schema";
-import { ComputedField } from "./ScriptField";
+import { ComputedField, ScriptField } from "./ScriptField";
import { Cast, FieldValue, NumCast, StrCast, ToConstructor, ScriptCast } from "./Types";
import { deleteProperty, getField, getter, makeEditable, makeReadOnly, setter, updateFunction } from "./util";
import { Docs } from "../client/documents/Documents";
@@ -913,6 +913,22 @@ export namespace Doc {
return false;
}
+ export function makeStarburst(newCollection: Doc) {
+ newCollection._layoutEngine = "starburst";
+ newCollection._fitToBox = true;
+ newCollection.overflow = "visible";
+ const script = "if (self._layoutEngine === 'starburst') {" +
+ " self._layoutEngine = 'pass';" +
+ " self.overflow = undefined;" +
+ " self.fitToContentScaling=undefined;" +
+ " } else {" +
+ " self._layoutEngine = 'starburst';" +
+ " self.overflow = 'visible';" +
+ " self.fitToContentScaling=10;" +
+ " };";
+ newCollection.onClick = ScriptField.MakeScript(script, { self: Doc.name });
+ }
+
export async function addFieldEnumerations(doc: Opt<Doc>, enumeratedFieldKey: string, enumerations: { title: string, _backgroundColor?: string, color?: string }[]) {
let optionsCollection = await DocServer.GetRefField(enumeratedFieldKey);