diff --git a/src/components/AnnotationManifestsAccordion.js b/src/components/AnnotationManifestsAccordion.js index bae843da4dbb8745fa56980e456f63f81beffc6d..68b53430d72aa7c0d6b53e0149507eb45cf87892 100644 --- a/src/components/AnnotationManifestsAccordion.js +++ b/src/components/AnnotationManifestsAccordion.js @@ -18,6 +18,7 @@ export class AnnotationManifestsAccordion extends Component { constructor(props) { super(props); this.handleOpenManifestSideToSide = this.handleOpenManifestSideToSide.bind(this); + this.handleOpenAccordion = this.handleOpenAccordion.bind(this); } /** */ @@ -27,6 +28,11 @@ export class AnnotationManifestsAccordion extends Component { addWindow({ manifestId }); } + /** */ + handleOpenAccordion(e) { + e.stopPropagation(); + } + /** */ render() { const { @@ -40,20 +46,21 @@ export class AnnotationManifestsAccordion extends Component { ); } - console.log(annotation); annotation.idIsManifest = !!searchManifest(annotation.id); annotation.manifestsInContent = searchManifest(annotation.content); - if (annotation.manifestsInContent === null && annotation.idIsManifest) { + if (annotation.manifestsInContent === null && !annotation.idIsManifest) { return null; } return ( (annotation.idIsManifest || annotation.manifestsInContent) && ( <div> + {annotation.idIsManifest} <Accordion> <AccordionSummary expandIcon={<ExpandMoreIcon />} + onClick={(e) => this.handleOpenAccordion(e)} > <Typography className={classes.heading}>Manifests found :</Typography> </AccordionSummary> @@ -103,7 +110,7 @@ export class AnnotationManifestsAccordion extends Component { AnnotationManifestsAccordion.propsTypes = { addResource: PropTypes.func.isRequired, addWindow: PropTypes.func.isRequired, - annotation: PropTypes.objectOf( + annotation: PropTypes.shape( { id: PropTypes.string.isRequired, idIsManifest: PropTypes.bool, @@ -115,7 +122,6 @@ AnnotationManifestsAccordion.propsTypes = { }; AnnotationManifestsAccordion.defaultProps = { - annotation: {}, classes: {}, htmlSanitizationRuleSet: 'iiif', listContainerComponent: 'li', diff --git a/src/components/CanvasAnnotations.js b/src/components/CanvasAnnotations.js index f0cd9adc4e7e23b94535b7b4a994738a12048477..b4d39c6b9d48dfea11acdd086df158bb14348ec2 100644 --- a/src/components/CanvasAnnotations.js +++ b/src/components/CanvasAnnotations.js @@ -57,12 +57,11 @@ export class CanvasAnnotations extends Component { */ render() { const { - annotations, autoScroll, classes, index, label, selectedAnnotationId, t, totalSize, listContainerComponent, htmlSanitizationRuleSet, hoveredAnnotationIds, + annotations, autoScroll, classes, index, label, selectedAnnotationId, t, totalSize, containerRef, } = this.props; if (annotations.length === 0) return null; - console.log(annotations); return ( <> <Typography className={classes.sectionHeading} variant="overline"> @@ -106,13 +105,15 @@ export class CanvasAnnotations extends Component { <Chip size="small" variant="outlined" label={tag} id={tag} className={classes.chip} key={tag.toString()} /> )) } + <AnnotationManifestsAccordion + annotation={annotation} + t={t} + /> </div> </ListItemText> + </MenuItem> - <AnnotationManifestsAccordion - annotation={annotation} - t={t} - /> + </ScrollTo> )) }