diff options
author | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-11-02 23:02:51 +0800 |
---|---|---|
committer | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-11-02 23:02:51 +0800 |
commit | 5ed05b89fbe1b5ccc34dfd342098bd1e6ac3935c (patch) | |
tree | 5053a94da01637f65498801257144c1d5e63d480 | |
parent | c8a8f569eefb4daad6da25d9be2a939589ccb704 (diff) |
bug fix - avoiding document view
-rw-r--r-- | src/client/views/nodes/PresBox.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 518d365ed..699f56620 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -412,7 +412,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> onHideDocument = () => { this.childDocs.forEach((doc, index) => { const curDoc = Cast(doc, Doc, null); - const tagDoc = Cast(curDoc.presentationTargetDoc!, Doc, null); + const tagDoc = Cast(curDoc.presentationTargetDoc, Doc, null); if (tagDoc) tagDoc.opacity = 1; const itemIndexes: number[] = this.getAllIndexes(this.tagDocs, tagDoc); const curInd: number = itemIndexes.indexOf(index); @@ -644,7 +644,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> @computed get listOfSelected() { const list = Array.from(this._selectedArray.keys()).map((doc: Doc, index: any) => { const curDoc = Cast(doc, Doc, null); - const tagDoc = Cast(curDoc.presentationTargetDoc!, Doc, null); + const tagDoc = Cast(curDoc.presentationTargetDoc, Doc, null); if (curDoc && curDoc === this.activeItem) return <div key={index} className="selectedList-items"><b>{index + 1}. {curDoc.title}</b></div>; else if (tagDoc) return <div key={index} className="selectedList-items">{index + 1}. {curDoc.title}</div>; else if (curDoc) return <div key={index} className="selectedList-items">{index + 1}. {curDoc.title}</div>; @@ -653,9 +653,9 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> } @action - selectPres = (pres?: Doc) => { - const presDocView = DocumentManager.Instance.getDocumentView(pres ? pres : this.rootDoc)!; - SelectionManager.SelectDoc(presDocView, false); + selectPres = () => { + const presDocView = DocumentManager.Instance.getDocumentView(this.rootDoc); + presDocView && SelectionManager.SelectDoc(presDocView, false); } //Regular click |