diff options
| author | bobzel <zzzman@gmail.com> | 2022-06-08 01:17:24 -0400 | 
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-06-08 01:17:24 -0400 | 
| commit | f8840672a7bcb3f337d8e50098f374a1b2d441ce (patch) | |
| tree | ae91a89fb8711c0fa216402c58c4acc130c65028 /src/client/util/CurrentUserUtils.ts | |
| parent | 3bf78af650a17db0a836118cb49159fd94cb8de2 (diff) | |
added ability to make thumbnails of dashboards. started to cleanup dockingView/goldenlayout undo event handling.  cleaned up tab doc list in docking view.  made titles editable again in treeview.  fixed overlay view to work with image docs etc by setting top/left in css
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
| -rw-r--r-- | src/client/util/CurrentUserUtils.ts | 26 | 
1 files changed, 20 insertions, 6 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 51bfdbbd2..885679b64 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -8,7 +8,7 @@ import { PrefetchProxy } from "../../fields/Proxy";  import { RichTextField } from "../../fields/RichTextField";  import { ComputedField, ScriptField } from "../../fields/ScriptField";  import { BoolCast, Cast, DateCast, NumCast, PromiseValue, StrCast } from "../../fields/Types"; -import { nullAudio } from "../../fields/URLField"; +import { ImageField, nullAudio } from "../../fields/URLField";  import { SharingPermissions } from "../../fields/util";  import { Utils } from "../../Utils";  import { DocServer } from "../DocServer"; @@ -22,11 +22,10 @@ import { TreeView } from "../views/collections/TreeView";  import { Colors } from "../views/global/globalEnums";  import { MainView } from "../views/MainView";  import { ButtonType, NumButtonType } from "../views/nodes/button/FontIconBox"; -import { LabelBox } from "../views/nodes/LabelBox";  import { CollectionFreeFormDocumentView } from "../views/nodes/CollectionFreeFormDocumentView";  import { OverlayView } from "../views/OverlayView";  import { DocumentManager } from "./DocumentManager"; -import { DragManager, dropActionType } from "./DragManager"; +import { DragManager } from "./DragManager";  import { makeTemplate, MakeTemplate } from "./DropConverter";  import { HistoryUtil } from "./History";  import { LinkManager } from "./LinkManager"; @@ -1185,9 +1184,24 @@ export class CurrentUserUtils {      }      public static async snapshotDashboard(userDoc: Doc) { -        const copy = await CollectionDockingView.Copy(CurrentUserUtils.ActiveDashboard); -        Doc.AddDocToList(Cast(userDoc.myDashboards, Doc, null), "data", copy); -        CurrentUserUtils.openDashboard(userDoc, copy); +        const docView = CollectionDockingView.Instance.props.DocumentView?.(); +        const content = docView?.ContentDiv; +        if (docView && content) { +            const _width = Number(getComputedStyle(content).width.replace("px","")); +            const _height = Number(getComputedStyle(content).height.replace("px","")); +            CollectionFreeFormView.UpdateIcon( +                docView.layoutDoc[Id] + "-icon" + (new Date()).getTime(), +                content, +                _width, _height, +                _width, _height, 0, +                (iconFile, _nativeWidth, _nativeHeight) => { +                    const img = Docs.Create.ImageDocument(new ImageField(iconFile), { title: docView.rootDoc.title+"-icon", _width, _height, _nativeWidth, _nativeHeight}); +                    const proto = Cast(img.proto, Doc, null)!; +                    proto["data-nativeWidth"] = _width; +                    proto["data-nativeHeight"] = _height; +                    docView.dataDoc.thumb = img; +                }); +        }      }      public static createNewDashboard = async (userDoc: Doc, id?: string) => {  | 
