aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorNaafiyan Ahmed <naafiyan@gmail.com>2022-08-19 12:32:23 -0400
committerNaafiyan Ahmed <naafiyan@gmail.com>2022-08-19 12:32:23 -0400
commitb7c4d65a3bf04ff7d2c10d93be282a1b0a4650b3 (patch)
treeffe7ade8cff2831d1fb4652312963f84289514bd /src/client/documents/Documents.ts
parent94c38310c6b54d93e907007f20ba032d12697ca0 (diff)
added comments, cleaned up code, could not get spinner to center
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index f3ab7c788..9e140ccd1 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -815,6 +815,7 @@ export namespace Docs {
dataProps[fieldKey + '-annotations'] = new List<Doc>();
dataProps[fieldKey + '-sidebar'] = new List<Doc>();
+ // users placeholderDoc as proto if it exists
const dataDoc = Doc.assign(placeholderDoc ? Doc.GetProto(placeholderDoc) : Doc.MakeDelegate(proto, protoId), dataProps, undefined, true);
if (placeholderDoc) {
@@ -826,6 +827,7 @@ export namespace Docs {
viewFirstProps['acl-Override'] = 'None';
viewFirstProps.author = Doc.CurrentUserEmail;
let viewDoc: Doc;
+ // determines whether viewDoc should be created using placeholder Doc or deafult
if (placeholderDoc) {
placeholderDoc._height = Number(options._height);
placeholderDoc._width = Number(options._width);
@@ -904,13 +906,13 @@ export namespace Docs {
return InstanceFromProto(Prototypes.get(DocumentType.COLOR), '', options);
}
- export const filesToDocs = new Map<Doc, File | string>();
+ // Mapping of all loading docs to files, i.e. keeps track of files being uploaded in current session
+ export const docsToFiles = new Map<Doc, File | string>();
export function LoadingDocument(file: File | string, options: DocumentOptions, ytString?: string) {
const fileName = typeof file == 'string' ? file : file.name;
options.title = fileName;
- const loading = InstanceFromProto(Prototypes.get(DocumentType.LOADING), fileName, { _height: 150, _width: 150, ...options });
- // filesToDocs.set(loading, file);
+ const loading = InstanceFromProto(Prototypes.get(DocumentType.LOADING), fileName, { _height: 150, _width: 200, ...options });
return loading;
}