diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index fc210e9a2..cc8052d44 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -111,7 +111,7 @@ export namespace Documents { { x: 0, y: 0, width: 300, height: 300, layoutKeys: [KeyStore.Data] }); } function GetCollectionPrototype(): Document { - return collProto ? collProto : + return collProto ? collProto.MakeDelegate() : collProto = setupPrototypeOptions(collProtoId, "COLLECTION_PROTO", CollectionView.LayoutString("DataKey"), { panx: 0, pany: 0, scale: 1, layoutKeys: [KeyStore.Data] }); } @@ -128,28 +128,28 @@ export namespace Documents { doc.SetText(KeyStore.Caption, "my caption..."); doc.SetText(KeyStore.BackgroundLayout, EmbeddedCaption()); doc.SetText(KeyStore.OverlayLayout, FixedCaption()); - return doc; + return doc.MakeDelegate(); } export function TextDocument(options: DocumentOptions = {}) { - return SetInstanceOptions(GetTextPrototype(), options, "", TextField); + return SetInstanceOptions(GetTextPrototype(), options, "", TextField).MakeDelegate() } export function PdfDocument(url: string, options: DocumentOptions = {}) { - return SetInstanceOptions(GetPdfPrototype(), options, new URL(url), PDFField); + return SetInstanceOptions(GetPdfPrototype(), options, new URL(url), PDFField).MakeDelegate(); } export function WebDocument(url: string, options: DocumentOptions = {}) { - return SetInstanceOptions(GetWebPrototype(), options, new URL(url), WebField); + return SetInstanceOptions(GetWebPrototype(), options, new URL(url), WebField).MakeDelegate(); } export function HtmlDocument(html: string, options: DocumentOptions = {}) { - return SetInstanceOptions(GetWebPrototype(), options, html, HtmlField); + return SetInstanceOptions(GetWebPrototype(), options, html, HtmlField).MakeDelegate(); } export function FreeformDocument(documents: Array<Document>, options: DocumentOptions, id?: string) { - return SetInstanceOptions(GetCollectionPrototype(), { ...options, viewType: CollectionViewType.Freeform }, documents, ListField, id) + return SetInstanceOptions(GetCollectionPrototype(), { ...options, viewType: CollectionViewType.Freeform }, documents, ListField, id).MakeDelegate() } export function SchemaDocument(documents: Array<Document>, options: DocumentOptions, id?: string) { - return SetInstanceOptions(GetCollectionPrototype(), { ...options, viewType: CollectionViewType.Schema }, documents, ListField, id) + return SetInstanceOptions(GetCollectionPrototype(), { ...options, viewType: CollectionViewType.Schema }, documents, ListField, id).MakeDelegate() } export function DockDocument(config: string, options: DocumentOptions, id?: string) { - return SetInstanceOptions(GetCollectionPrototype(), { ...options, viewType: CollectionViewType.Docking }, config, TextField, id) + return SetInstanceOptions(GetCollectionPrototype(), { ...options, viewType: CollectionViewType.Docking }, config, TextField, id).MakeDelegate() } export function KVPDocument(document: Document, options: DocumentOptions = {}, id?: string) { var deleg = GetKVPPrototype().MakeDelegate(id); |