aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx10
-rw-r--r--src/fields/Doc.ts4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index ba9385514..480abdaed 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -114,10 +114,10 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
}
public static setupZoom(doc: Doc, zoomProgressivize: boolean = false) {
- let width = new List<number>();
- let height = new List<number>();
- let top = new List<number>();
- let left = new List<number>();
+ const width = new List<number>();
+ const height = new List<number>();
+ const top = new List<number>();
+ const left = new List<number>();
width.push(NumCast(doc.width));
height.push(NumCast(doc.height));
top.push(NumCast(doc.height) / -2);
@@ -176,7 +176,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
NativeWidth={this.NativeWidth}
PanelWidth={this.panelWidth}
PanelHeight={this.panelHeight} />;
- if (this.layoutDoc === PresBox.Instance.childDocs[PresBox.Instance.itemIndex]?.presentationTargetDoc) {
+ if (PresBox.Instance && this.layoutDoc === PresBox.Instance.childDocs[PresBox.Instance.itemIndex]?.presentationTargetDoc) {
const effectProps = {
left: this.layoutDoc.presEffectDirection === 'left',
right: this.layoutDoc.presEffectDirection === 'right',
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index e28f6b7d2..cc90574a2 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -595,7 +595,7 @@ export namespace Doc {
var zip = new JSZip();
- zip.file("doc.json", docString);
+ zip.file(doc.title + ".json", docString);
// // Generate a directory within the Zip file structure
// var img = zip.folder("images");
@@ -607,7 +607,7 @@ export namespace Doc {
zip.generateAsync({ type: "blob" })
.then((content: any) => {
// Force down of the Zip file
- saveAs(content, "download.zip");
+ saveAs(content, doc.title + ".zip"); // glr: Possibly change the name of the document to match the title?
});
}
//