From f3f74570b6bb6433ea6367c57d4be7b5c00bec4b Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 4 Jun 2022 23:36:57 -0400 Subject: fixed mini pres to work on startup when last mode was tree by not clearing out linearized documents. --- src/client/views/nodes/trails/PresBox.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') 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() { { 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(); + } @computed get selectedDocumentView() { if (SelectionManager.Views().length) return SelectionManager.Views()[0]; @@ -617,8 +616,8 @@ export class PresBox extends ViewBoxBaseComponent() { 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() { //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() { } console.log(String(index), treeViewDoc) this._treeViewMap.delete(indexNum); - this.props.Document.presentationLinearizedDocuments = new List(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(this.sort(this._treeViewMap)); + } return this.childDocs; } -- cgit v1.2.3-70-g09d2