diff --git a/src/components/CanvasAnnotations.js b/src/components/CanvasAnnotations.js index f45870f929b579c532d7be7a09468bc4fbdc3942..827fe8f4d4a37713aff90697d25f889aa666c5eb 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> )) }