diff options
-rw-r--r-- | src/client/documents/Documents.ts | 10 | ||||
-rw-r--r-- | src/client/util/CurrentUserUtils.ts | 3 | ||||
-rw-r--r-- | src/client/views/Main.tsx | 10 |
3 files changed, 14 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 905ca324c..b5b179d3a 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -239,7 +239,7 @@ export interface DocumentOptions { border?: string; //for searchbox _hovercolor?: string; } -/* + let _docOptions: DocumentOptions = { system: { type: "string", description: "is document created/owned by the system", dflt: false }, _autoHeight: { type: "boolean", description: "whether document automatically resizes vertically to display contents", dflt: false }, @@ -255,7 +255,9 @@ let _docOptions: DocumentOptions = { _dimMagnitude: { type: "number", description: "magnitude of collectionMulti{row,col} element's width or height" }, _dimUnit: { type: "string", description: "units of collectionMulti{row,col} element's width or height - 'px' or '*' for pixels or relative units" }, _fitWidth: { type: "boolean", description: "whether document should scale its contents to fit its rendered width or not (e.g., for PDFviews)" } - /*_fitToBox?: boolean; // whether a freeformview should zoom/scale to create a shrinkwrapped view of its contents + +} +/*_fitToBox?: boolean; // whether a freeformview should zoom/scale to create a shrinkwrapped view of its contents _freeformLOD?: boolean; // whether to use LOD to render a freeform document _showTitle?: string; // field name to display in header (:hover is an optional suffix) _showCaption?: string; // which field to display in the caption area. leave empty to have no caption @@ -426,12 +428,12 @@ export namespace Docs { export let FieldInfos: Doc | undefined; export async function setupFieldInfos() { - const fieldDocs = await DocServer.GetRefField("FIELDS"); + const fieldDocs = await DocServer.GetRefField("FieldInfos"); if (fieldDocs instanceof Doc) { Docs.FieldInfos = fieldDocs; } else { runInAction(() => { - const infos = Docs.FieldInfos = new Doc("FIELDS", true); + const infos = Docs.FieldInfos = new Doc("FieldInfos", true); const keys = Object.keys(_docOptions); for (let i = 0; i < keys.length; i++) { const key = keys[i]; diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 3413f7b05..dcaf61fea 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -1050,6 +1050,7 @@ export class CurrentUserUtils { // } // }); setTimeout(() => DocServer.UPDATE_SERVER_CACHE(), 2500); + doc.fieldInfos = Docs.FieldInfos; return doc; } @@ -1069,7 +1070,7 @@ export class CurrentUserUtils { } public static async loadUserDocument(id: string) { - //await Docs.setupFieldInfos(); + await Docs.setupFieldInfos(); this.curr_id = id; await rp.get(Utils.prepend("/getUserDocumentIds")).then(ids => { const { userDocumentId, sharingDocumentId, linkDatabaseId } = JSON.parse(ids); diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 5063c6f6b..92f6ae028 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -1,10 +1,12 @@ -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import { AssignAllExtensions } from "../../extensions/General/Extensions"; +import { MainView } from "./MainView"; import { Docs } from "../documents/Documents"; import { CurrentUserUtils } from "../util/CurrentUserUtils"; +import * as ReactDOM from 'react-dom'; +import * as React from 'react'; +import { DocServer } from "../DocServer"; +import { AssignAllExtensions } from "../../extensions/General/Extensions"; +import { Networking } from "../Network"; import { CollectionView } from "./collections/CollectionView"; -import { MainView } from "./MainView"; AssignAllExtensions(); |