aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/CurrentUserUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-09 16:59:09 -0400
committerbobzel <zzzman@gmail.com>2022-06-09 16:59:09 -0400
commit140e2f643f97057ba9c89c502cff7843bd738cd6 (patch)
tree033330390616fde7a6b3797f2a71153e28939e51 /src/client/util/CurrentUserUtils.ts
parent8ef0c6c08bd9c2e3654477b039686bab6b0ff991 (diff)
fixed issues with taking dashboard snapshots to update dashboard view
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
-rw-r--r--src/client/util/CurrentUserUtils.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index b1329e349..2d2dda2b8 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -1183,13 +1183,13 @@ export class CurrentUserUtils {
input.click();
}
- public static async snapshotDashboard(userDoc: Doc) {
+ public static CaptureDashboardThumbnail() {
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(
+ return CollectionFreeFormView.UpdateIcon(
docView.layoutDoc[Id] + "-icon" + (new Date()).getTime(),
content,
_width, _height,
@@ -1199,10 +1199,13 @@ export class CurrentUserUtils {
const proto = Cast(img.proto, Doc, null)!;
proto["data-nativeWidth"] = _width;
proto["data-nativeHeight"] = _height;
- docView.dataDoc.thumb = img;
+ Doc.GetProto(CurrentUserUtils.ActiveDashboard).thumb = img;
});
}
+ }
+
+ 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);