aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-10-02 20:52:10 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-10-02 20:52:10 +0800
commit805bf106c85f693f6e6d15c06cacd5e16079c707 (patch)
tree872f84dee5ffcae04fbfe128941c0429f3aee562 /src/client/documents/Documents.ts
parent3b14058df2cf9cb444836a6b1fea92835eb51761 (diff)
parent1dee63242684f02543cf7667b53baa00d10ab6c1 (diff)
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 47fa7067d..7ee8267f8 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -574,7 +574,7 @@ export namespace Docs {
* only when creating a DockDocument from the current user's already existing
* main document.
*/
- export function InstanceFromProto(proto: Doc, data: Field | undefined, options: DocumentOptions, delegId?: string, fieldKey: string = "data") {
+ export function InstanceFromProto(proto: Doc, data: Field | undefined, options: DocumentOptions, delegId?: string, fieldKey: string = "data", protoId?: string) {
const { omit: protoProps, extract: delegateProps } = OmitKeys(options, delegateKeys, "^_");
protoProps.system = delegateProps.system;
@@ -590,7 +590,7 @@ export namespace Docs {
protoProps.isPrototype = true;
- const dataDoc = MakeDataDelegate(proto, protoProps, data, fieldKey);
+ const dataDoc = MakeDataDelegate(proto, protoProps, data, fieldKey, protoId);
const viewDoc = Doc.MakeDelegate(dataDoc, delegId);
// so that the list of annotations is already initialised, prevents issues in addonly.
@@ -620,8 +620,8 @@ export namespace Docs {
* @param options initial values to apply to this new delegate
* @param value the data to store in this new delegate
*/
- function MakeDataDelegate<D extends Field>(proto: Doc, options: DocumentOptions, value?: D, fieldKey: string = "data") {
- const deleg = Doc.MakeDelegate(proto);
+ function MakeDataDelegate<D extends Field>(proto: Doc, options: DocumentOptions, value?: D, fieldKey: string = "data", id: string | undefined = undefined) {
+ const deleg = Doc.MakeDelegate(proto, id);
if (value !== undefined) {
deleg[fieldKey] = value;
}
@@ -807,8 +807,8 @@ export namespace Docs {
return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { _chromeStatus: "collapsed", dontRegisterChildViews: true, ...options, _viewType: CollectionViewType.Tree }, id);
}
- export function StackingDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) {
- return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { _chromeStatus: "collapsed", ...options, _viewType: CollectionViewType.Stacking }, id);
+ export function StackingDocument(documents: Array<Doc>, options: DocumentOptions, id?: string, protoId?: string) {
+ return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { _chromeStatus: "collapsed", ...options, _viewType: CollectionViewType.Stacking }, id, undefined, protoId);
}
export function MulticolumnDocument(documents: Array<Doc>, options: DocumentOptions) {