From 1902bafcab8e6b9d62e7c7c881927d2e45d71f7a Mon Sep 17 00:00:00 2001 From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr> Date: Mon, 30 Jan 2023 10:16:37 +0100 Subject: [PATCH] Revert "WIP on accordion in a component" This reverts commit afa0281ba7926c5b38cf9338997ff2c5c9e21c67. --- src/components/CanvasAnnotations.js | 52 +++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/src/components/CanvasAnnotations.js b/src/components/CanvasAnnotations.js index f45870f92..827fe8f4d 100644 --- a/src/components/CanvasAnnotations.js +++ b/src/components/CanvasAnnotations.js @@ -30,7 +30,6 @@ export class CanvasAnnotations extends Component { this.handleAnnotationHover = this.handleAnnotationHover.bind(this); this.handleAnnotationBlur = this.handleAnnotationBlur.bind(this); this.handleOpenManifestSideToSide = this.handleOpenManifestSideToSide.bind(this); - this.handleAccordion = this.handleAccordion.bind(this); } /** @@ -68,10 +67,6 @@ export class CanvasAnnotations extends Component { addWindow({ manifestId }); } - handleAccordion() { - console.log("openAccordion"); - } - /** * Returns the rendered component */ @@ -142,11 +137,54 @@ export class CanvasAnnotations extends Component { )) } </div> - </ListItemText> - </MenuItem> + { + (annotation.idIsManifest || annotation.manifestsInContent) && ( + <div> + <Accordion> + <AccordionSummary + expandIcon={<ExpandMoreIcon />} + > + <Typography className={classes.heading}>Manifests found :</Typography> + </AccordionSummary> + <AccordionDetails> + <Typography> + {annotation.idIsManifest && ( + <div className={classes.manifestOpeningWrapper}> + <div>{annotation.id}</div> + <MiradorMenuButton + aria-haspopup="true" + aria-label={t('openManifestInOtherWindow', { manifest: annotation.id })} + titleAccess={t('openManifestInOtherWindow', { manifest: annotation.id })} + onClick={(e) => { this.handleOpenManifestSideToSide(e, annotation.id); }} + className={classes.manifestOpeningButton} + > + <PlaylistAddIcon /> + </MiradorMenuButton> + </div> + )} + {annotation.manifestsInContent && annotation.manifestsInContent.map(manifestId => ( + <div className={classes.manifestOpeningWrapper}> + <div>{manifestId}</div> + <MiradorMenuButton + aria-haspopup="true" + aria-label={t('openManifestInOtherWindow')} + titleAccess={t('openManifestInOtherWindow')} + onClick={(e) => { this.handleOpenManifestSideToSide(e, manifestId); }} + className={classes.manifestOpeningButton} + > + <PlaylistAddIcon /> + </MiradorMenuButton> + </div> + ))} + </Typography> + </AccordionDetails> + </Accordion> + </div> + ) + } </ScrollTo> )) } -- GitLab