diff options
| author | madelinegr <mgriswold99@gmail.com> | 2019-06-07 18:08:18 -0400 |
|---|---|---|
| committer | madelinegr <mgriswold99@gmail.com> | 2019-06-07 18:08:18 -0400 |
| commit | f88bb6cb27d84041637ac31d8b4b82a710367dfb (patch) | |
| tree | 9cf32a62c1d75319cfb74068ce50b63c61f53c69 /src/client/views/presentationview/PresentationView.tsx | |
| parent | cd15824429fbac94c8342af15acb7ec472506715 (diff) | |
Navigation done
Diffstat (limited to 'src/client/views/presentationview/PresentationView.tsx')
| -rw-r--r-- | src/client/views/presentationview/PresentationView.tsx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx index efc333ee3..cbfad56d1 100644 --- a/src/client/views/presentationview/PresentationView.tsx +++ b/src/client/views/presentationview/PresentationView.tsx @@ -222,6 +222,32 @@ export class PresentationView extends React.Component<PresViewProps> { }); } + navigateToElement = (curDoc: Doc) => { + let docToJump: Doc = curDoc; + let curDocPresId = StrCast(curDoc.presentId, null); + + if (curDocPresId !== undefined) { + if (this.groupMappings.has(curDocPresId)) { + let currentDocGroup = this.groupMappings.get(curDocPresId)!; + currentDocGroup.forEach((doc: Doc, index: number) => { + let selectedButtons: boolean[] = this.presElementsMappings.get(doc)!.selected; + if (selectedButtons[buttonIndex.Navigate]) { + docToJump = doc; + } + }); + } + + } + if (docToJump === curDoc) { + if (this.presElementsMappings.get(curDoc)!.selected[buttonIndex.Navigate]) { + DocumentManager.Instance.jumpToDocument(curDoc); + } else { + return; + } + } + DocumentManager.Instance.jumpToDocument(docToJump); + } + getDocAtIndex = async (index: number) => { const list = FieldValue(Cast(this.props.Document.data, listSpec(Doc))); if (!list) { @@ -255,7 +281,8 @@ export class PresentationView extends React.Component<PresViewProps> { this.props.Document.selectedDoc = index; const doc = await list[index]; - DocumentManager.Instance.jumpToDocument(doc); + // DocumentManager.Instance.jumpToDocument(doc); + this.navigateToElement(doc); this.hideIfNotPresented(index); this.showAfterPresented(index); |
