diff options
-rw-r--r-- | src/client/views/presentationview/PresentationElement.tsx | 6 | ||||
-rw-r--r-- | src/client/views/presentationview/PresentationList.tsx | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/client/views/presentationview/PresentationElement.tsx b/src/client/views/presentationview/PresentationElement.tsx index fcddb2ad4..95e949b87 100644 --- a/src/client/views/presentationview/PresentationElement.tsx +++ b/src/client/views/presentationview/PresentationElement.tsx @@ -35,6 +35,8 @@ interface PresentationElementProps { presButtonBackUp: Doc; presGroupBackUp: Doc; removeDocByRef(doc: Doc): boolean; + setPresElementsMappings: (keyDoc: Doc, elem: PresentationElement) => void; + } @@ -90,7 +92,7 @@ export default class PresentationElement extends React.Component<PresentationEle //Lifecycle function that makes sure that button BackUp is received when mounted. async componentDidMount() { this.receiveButtonBackUp(); - + //this.props.setPresElementsMappings(this.props.document, this); if (this.presElRef.current) { this.header = this.presElRef.current; this.createListDropTarget(this.presElRef.current); @@ -100,6 +102,8 @@ export default class PresentationElement extends React.Component<PresentationEle //Lifecycle function that makes sure button BackUp is received when not re-mounted bu re-rendered. async componentDidUpdate() { //this.receiveButtonBackUp(); + //this.props.setPresElementsMappings(this.props.document, this); + if (this.presElRef.current) { this.header = this.presElRef.current; this.createListDropTarget(this.presElRef.current); diff --git a/src/client/views/presentationview/PresentationList.tsx b/src/client/views/presentationview/PresentationList.tsx index 35af451dd..90a163f20 100644 --- a/src/client/views/presentationview/PresentationList.tsx +++ b/src/client/views/presentationview/PresentationList.tsx @@ -88,7 +88,11 @@ export default class PresentationViewList extends React.Component<PresListProps> <div className="presentationView-listCont" > {children.map((doc: Doc, index: number) => <PresentationElement - ref={(e) => { if (e) { this.props.setPresElementsMappings(doc, e); } }} + ref={(e) => { + if (e) { + this.props.setPresElementsMappings(doc, e); + } + }} key={doc[Id]} mainDocument={this.props.mainDocument} document={doc} @@ -101,6 +105,7 @@ export default class PresentationViewList extends React.Component<PresListProps> presButtonBackUp={this.props.presButtonBackUp} presGroupBackUp={this.props.presGroupBackUp} removeDocByRef={this.props.removeDocByRef} + setPresElementsMappings={this.props.setPresElementsMappings} /> )} </div> |