diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/DocServer.ts | 13 | ||||
-rw-r--r-- | src/client/documents/Documents.ts | 6 | ||||
-rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 8 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 3b33657eb..067d89c51 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -146,9 +146,10 @@ export namespace DocServer { const promises: Promise<Opt<RefField>>[] = []; const map: { [id: string]: Opt<RefField> } = {}; - // 1) an initial pass through the cache to determine which documents need to be fetched, - // which are already in the process of being fetched and which already exist in the - // cache + // 1) an initial pass through the cache to determine + // i) which documents need to be fetched + // ii) which are already in the process of being fetched + // iii) which already exist in the cache for (const id of ids) { const cached = _cache[id]; if (cached === undefined) { @@ -204,7 +205,7 @@ export namespace DocServer { // 6) with this confidence, we can now go through and update the cache at the ids of the fields that // we explicitly had to fetch. To finish it off, we add whatever value we've come up with for a given - // id to the soon to be returned field mapping. + // id to the soon-to-be-returned field mapping. requestedIds.forEach(id => { const field = fields[id]; // either way, overwrite or delete any promises (that we inserted as flags @@ -232,8 +233,8 @@ export namespace DocServer { // now, we return our completed mapping from all of the ids that were passed into the method // to their actual RefField | undefined values. This return value either becomes the input - // argument to the caller's promise (i.e. GetRefFields.then(map => //do something with map...)) - // or it is the direct return result if the promise is awaited. + // argument to the caller's promise (i.e. GetRefFields(["_id1_", "_id2_", "_id3_"]).then(map => //do something with map...)) + // or it is the direct return result if the promise is awaited (i.e. let fields = await GetRefFields(["_id1_", "_id2_", "_id3_"])). return map; } diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 758291b9b..782c133ff 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -96,7 +96,7 @@ export namespace Docs { */ export async function initialize(): Promise<void> { // non-guid string ids for each document prototype - let protoIds = [textProtoId, histoProtoId, collProtoId, imageProtoId, webProtoId, kvpProtoId, videoProtoId, audioProtoId, pdfProtoId, iconProtoId] + let protoIds = [textProtoId, histoProtoId, collProtoId, imageProtoId, webProtoId, kvpProtoId, videoProtoId, audioProtoId, pdfProtoId, iconProtoId]; // fetch the actual prototype documents from the server let actualProtos = await DocServer.getRefFields(protoIds); @@ -238,7 +238,7 @@ export namespace Docs { y: 0, width: 300, height: 150 - } + }; return buildPrototype(audioProtoId, "AUDIO_PROTO", AudioBox.LayoutString(), defaultAttrs); } } @@ -419,7 +419,7 @@ export namespace Docs { export type DocConfig = { doc: Doc, initialWidth?: number - } + }; export function StandardCollectionDockingDocument(configs: Array<DocConfig>, options: DocumentOptions, id?: string, type: string = "row") { let layoutConfig = { diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 4f5837590..5270a4624 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -141,11 +141,11 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp } injectParentProp = (contentArray: any[], reverse: boolean = false) => { - if (!contentArray || contentArray.length == 0) return; + if (!contentArray || contentArray.length === 0) return; contentArray.forEach(member => { let baseCase = Object.keys(member).includes("props"); if (!baseCase) { - this.injectParentProp(member.content, reverse) + this.injectParentProp(member.content, reverse); } else { reverse ? delete member.props.parent : member.props.parent = this; } @@ -386,10 +386,10 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp tab.header.parent.setActiveContentItem(tab.contentItem); } tab.setActive(true); - } + }; tab.header.element[0].ondrop = (e: any) => { console.log("DROPPPP THE BASS!", e); - } + }; ReactDOM.render(<ParentDocSelector Document={doc} addDocTab={(doc, location) => CollectionDockingView.AddTab(stack, doc)} />, upDiv); tab.reactComponents = [upDiv]; tab.element.append(upDiv); |