diff --git a/src/relations/RelationUtils.js b/src/relations/RelationUtils.js index 8ff999c..d439f3b 100644 --- a/src/relations/RelationUtils.js +++ b/src/relations/RelationUtils.js @@ -17,7 +17,7 @@ export const getNodeForEvent = function(evt) { const sortByQuoteLengthDesc = annotations => annotations.sort((a, b) => a.quote.length - b.quote.length); - const annotationSpan = evt.target.closest('.annotation'); + const annotationSpan = evt.target.closest('.r6o-annotation'); if (annotationSpan) { // All stacked annotation spans @@ -27,7 +27,7 @@ export const getNodeForEvent = function(evt) { const annotation = sortByQuoteLengthDesc(spans.map(span => span.annotation))[0]; // ALL spans for this annotation (not just the hovered one) - const elements = document.querySelectorAll(`.annotation[data-id="${annotation.id}"]`); + const elements = document.querySelectorAll(`.r6o-annotation[data-id="${annotation.id}"]`); return { annotation, elements: Array.from(elements) }; } @@ -50,6 +50,6 @@ export const getAnnotationSpansRecursive = function(element, s) { const parent = element.parentNode; - return parent.classList.contains('annotation') ? + return parent.classList.contains('r6o-annotation') ? getAnnotationSpansRecursive(parent, spans) : spans; } \ No newline at end of file diff --git a/src/relations/drawing/DrawingTool.js b/src/relations/drawing/DrawingTool.js index 399f85f..bc03f54 100644 --- a/src/relations/drawing/DrawingTool.js +++ b/src/relations/drawing/DrawingTool.js @@ -99,7 +99,7 @@ export default class DrawingTool extends EventEmitter { } /** Emphasise hovered annotation **/ - onEnterAnnotation = delegatingHandler('.annotation', evt => { + onEnterAnnotation = delegatingHandler('.r6o-annotation', evt => { if (this.currentHover) this.hover(); @@ -107,7 +107,7 @@ export default class DrawingTool extends EventEmitter { }); /** Clear hover emphasis **/ - onLeaveAnnotation = delegatingHandler('.annotation', evt => { + onLeaveAnnotation = delegatingHandler('.r6o-annotation', evt => { this.hover(); });