diff options
author | bobzel <zzzman@gmail.com> | 2022-06-04 23:36:57 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-06-04 23:36:57 -0400 |
commit | f3f74570b6bb6433ea6367c57d4be7b5c00bec4b (patch) | |
tree | d15ebaa2abe60d62f557b1d28439d79719dffb24 | |
parent | 84e843ccb21dcb95dff11e34b749f4587fc0fd86 (diff) |
fixed mini pres to work on startup when last mode was tree by not clearing out linearized documents.
-rw-r--r-- | src/client/views/nodes/trails/PresBox.tsx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index 914d6ab15..a434ed24d 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -140,8 +140,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { { field: "string", data: Doc.name, container: Doc.name }); } this.props.Document.presentationFieldKey = this.fieldKey; // provide info to the presElement script so that it can look up rendering information about the presBox - //TODO: [AL] change this - this.props.Document.presentationLinearizedDocuments = new List<Doc>(); + } @computed get selectedDocumentView() { if (SelectionManager.Views().length) return SelectionManager.Views()[0]; @@ -617,8 +616,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { this.rootDoc.y = pt[1] + 10; this.rootDoc._height = 30; this.rootDoc._width = 248; - this.props.removeDocument?.(this.layoutDoc); Doc.AddDocToList((Doc.UserDoc().myOverlayDocs as Doc), undefined, this.rootDoc); + this.props.removeDocument?.(this.layoutDoc); } } @@ -745,10 +744,6 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { //Regular click @action selectElement = async (doc: Doc) => { - console.log("tree docs are:", this._treeViewMap); - console.log("child docs are:", this.childDocs); - console.log("linearized docs:", this.rootDoc.presentationLinearizedDocuments); - console.log("got here", this.childDocs.indexOf(doc)); const context = Cast(doc.context, Doc, null); this.gotoDocument(this.childDocs.indexOf(doc), this.activeItem); if (doc.presPinView || doc.presentationTargetDoc === this.layoutDoc.presCollection) setTimeout(() => this.updateCurrentPresentation(context), 0); @@ -2465,7 +2460,10 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { } console.log(String(index), treeViewDoc) this._treeViewMap.delete(indexNum); - this.props.Document.presentationLinearizedDocuments = new List<Doc>(this.sort(this._treeViewMap)); + const overlay = (Doc.UserDoc().myOverlayDocs as Doc); + if (!DocListCast(overlay[Doc.LayoutFieldKey(overlay)]).includes(this.rootDoc)) { + this.props.Document.presentationLinearizedDocuments = new List<Doc>(this.sort(this._treeViewMap)); + } return this.childDocs; } |