diff options
| author | madelinegr <mgriswold99@gmail.com> | 2019-06-06 18:47:48 -0400 |
|---|---|---|
| committer | madelinegr <mgriswold99@gmail.com> | 2019-06-06 18:47:48 -0400 |
| commit | ecbf6dda7f410f866b1031966982b23b031e72ee (patch) | |
| tree | b7c8943f44e96b1a2710bbd74ad1832df207abe9 /src/client/views/presentationview/PresentationView.tsx | |
| parent | 51c59893afd84eb9f36669282cbf0479ee9d9f84 (diff) | |
Pres ELements mapped
Diffstat (limited to 'src/client/views/presentationview/PresentationView.tsx')
| -rw-r--r-- | src/client/views/presentationview/PresentationView.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx index 3263ea62e..0655418f4 100644 --- a/src/client/views/presentationview/PresentationView.tsx +++ b/src/client/views/presentationview/PresentationView.tsx @@ -20,6 +20,7 @@ interface PresListProps extends PresViewProps { deleteDocument(index: number): void; gotoDocument(index: number): void; groupMappings: Map<String, Doc[]>; + presElementsMappings: Map<Doc, PresentationElement>; } @@ -107,10 +108,10 @@ class PresentationViewList extends React.Component<PresListProps> { render() { const children = DocListCast(this.props.Document.data); this.initializeGroupIds(children); - return ( + <div className="presentationView-listCont"> - {children.map((doc: Doc, index: number) => <PresentationElement key={index} mainDocument={this.props.Document} document={doc} index={index} deleteDocument={this.props.deleteDocument} gotoDocument={this.props.gotoDocument} groupMappings={this.props.groupMappings} allListElements={children} />)} + {children.map((doc: Doc, index: number) => <PresentationElement ref={(e) => this.props.presElementsMappings.set(doc, e!)} key={index} mainDocument={this.props.Document} document={doc} index={index} deleteDocument={this.props.deleteDocument} gotoDocument={this.props.gotoDocument} groupMappings={this.props.groupMappings} allListElements={children} />)} </div> ); } @@ -123,6 +124,7 @@ export class PresentationView extends React.Component<PresViewProps> { @observable groupedMembers: Doc[][] = []; @observable groupMappings: Map<String, Doc[]> = new Map(); + @observable presElementsMappings: Map<Doc, PresentationElement> = new Map(); //observable means render is re-called every time variable is changed @observable @@ -197,7 +199,7 @@ export class PresentationView extends React.Component<PresViewProps> { <button className="presentation-button" onClick={this.back}>back</button> <button className="presentation-button" onClick={this.next}>next</button> </div> - <PresentationViewList Document={this.props.Document} deleteDocument={this.RemoveDoc} gotoDocument={this.gotoDocument} groupMappings={this.groupMappings} /> + <PresentationViewList Document={this.props.Document} deleteDocument={this.RemoveDoc} gotoDocument={this.gotoDocument} groupMappings={this.groupMappings} presElementsMappings={this.presElementsMappings} /> </div> ); } |
