diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-04-04 13:38:55 -0400 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-04-04 13:38:55 -0400 |
commit | 15c1c952c50bb2de972c614e46c5f33c2b2952cc (patch) | |
tree | e8d7330336b80939e82749290c22ef5a05b01224 /src/fields | |
parent | 479dff344ff2cf92ace9c68c3ce6d03e6e6dce22 (diff) | |
parent | ee17752109ba1238d645a4df7cee1cf60855f8df (diff) |
merging
Diffstat (limited to 'src/fields')
-rw-r--r-- | src/fields/Doc.ts | 16 | ||||
-rw-r--r-- | src/fields/documentSchemas.ts | 5 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 31043f5be..c36bfb04b 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -428,6 +428,11 @@ export namespace Doc { index = allowProtos && index !== -1 ? index : list.reduce((p, v, i) => (v instanceof Doc && Doc.AreProtosEqual(v, toFind)) ? i : p, -1); return index; // list.findIndex(doc => doc === toFind || Doc.AreProtosEqual(doc, toFind)); } + + /** + * Removes doc from the list of Docs at listDoc[fieldKey] + * @returns true if successful, false otherwise. + */ export function RemoveDocFromList(listDoc: Doc, fieldKey: string | undefined, doc: Doc) { const key = fieldKey ? fieldKey : Doc.LayoutFieldKey(listDoc); if (listDoc[key] === undefined) { @@ -443,6 +448,11 @@ export namespace Doc { } return false; } + + /** + * Adds doc to the list of Docs stored at listDoc[fieldKey]. + * @returns true if successful, false otherwise. + */ export function AddDocToList(listDoc: Doc, fieldKey: string | undefined, doc: Doc, relativeTo?: Doc, before?: boolean, first?: boolean, allowDuplicates?: boolean, reversed?: boolean) { const key = fieldKey ? fieldKey : Doc.LayoutFieldKey(listDoc); if (listDoc[key] === undefined) { @@ -476,9 +486,9 @@ export namespace Doc { return false; } - // - // Computes the bounds of the contents of a set of documents. - // + /** + * Computes the bounds of the contents of a set of documents. + */ export function ComputeContentBounds(docList: Doc[]) { const bounds = docList.reduce((bounds, doc) => { const [sptX, sptY] = [NumCast(doc.x), NumCast(doc.y)]; diff --git a/src/fields/documentSchemas.ts b/src/fields/documentSchemas.ts index 275249840..f17a390a6 100644 --- a/src/fields/documentSchemas.ts +++ b/src/fields/documentSchemas.ts @@ -75,9 +75,8 @@ export const documentSchema = createSchema({ textTransform: "string", treeViewOpen: "boolean", // flag denoting whether the documents sub-tree (contents) is visible or hidden treeViewExpandedView: "string", // name of field whose contents are being displayed as the document's subtree - treeViewLockExpandedView: "boolean", // whether the expanded view can be changed - treeViewDefaultExpandedView: "string", // name of field whose contents are displayed by default - treeViewPreventOpen: "boolean", // ignores the treeViewOpen flag (for allowing a view to not be slaved to other views of the document) + treeViewExpandedViewLock: "boolean", // whether the expanded view can be changed + treeViewOpenIsTransient: "boolean", // ignores the treeViewOpen flag (for allowing a view to not be slaved to other views of the document) treeViewType: "string", // whether tree view is an outline, file syste or (default) hierarchy. For outline, clicks edit document titles immediately since double-click opening is turned off // interaction and linking properties |