diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index fafb1af8a..059f88e96 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -246,6 +246,7 @@ export class DocumentOptions { layout_hideResizeHandles?: BOOLt = new BoolInfo('whether to hide the resize handles when selected'); layout_hideLinkButton?: BOOLt = new BoolInfo('whether the blue link counter button should be hidden'); layout_hideDecorationTitle?: BOOLt = new BoolInfo('whether to suppress the document decortations title when selected'); + layout_hideDecorations?: BOOLt = new BoolInfo('whether to suppress all document decortations when selected'); _layout_hideContextMenu?: BOOLt = new BoolInfo('whether the context menu can be shown'); layout_diagramEditor?: STRt = new StrInfo('specify the JSX string for a diagram editor view'); layout_hideContextMenu?: BOOLt = new BoolInfo('whether the context menu can be shown'); @@ -291,6 +292,7 @@ export class DocumentOptions { _text_fontSize?: string; _text_fontFamily?: string; _text_fontWeight?: string; + text_align?: STRt = new StrInfo('horizontal text alignment default'); fontSize?: string; _pivotField?: string; // field key used to determine headings for sections in stacking, masonry, pivot views @@ -721,6 +723,9 @@ export namespace Docs { updateCachedAcls(dataDoc); updateCachedAcls(viewDoc); + if (data instanceof List) { + data.map(item => item instanceof Doc && Doc.SetContainer(item, viewDoc)); + } return viewDoc; } @@ -910,15 +915,13 @@ export namespace Docs { } export function CalendarDocument(options: DocumentOptions, documents: Array<Doc>) { - const inst = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { + return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { _layout_nativeDimEditable: true, _layout_reflowHorizontal: true, _layout_reflowVertical: true, ...options, _type_collection: CollectionViewType.Calendar, }); - documents.forEach(d => Doc.SetContainer(d, inst)); - return inst; } // shouldn't ever need to create a KVP document-- instead set the LayoutTemplateString to be a KeyValueBox for the DocumentView (see addDocTab in TabDocView) @@ -927,9 +930,7 @@ export namespace Docs { // } export function FreeformDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) { - const inst = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Freeform }, id); - documents.forEach(d => Doc.SetContainer(d, inst)); - return inst; + return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Freeform }, id); } export function ConfigDocument(options: DocumentOptions, id?: string) { @@ -1034,9 +1035,7 @@ export namespace Docs { } export function DockDocument(documents: Array<Doc>, config: string, options: DocumentOptions, id?: string) { - const ret = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { treeView_FreezeChildren: 'remove|add', ...options, type_collection: CollectionViewType.Docking, dockingConfig: config }, id); - documents.map(c => Doc.SetContainer(c, ret)); - return ret; + return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { treeView_FreezeChildren: 'remove|add', ...options, type_collection: CollectionViewType.Docking, dockingConfig: config }, id); } export function DelegateDocument(proto: Doc, options: DocumentOptions = {}) { |