diff --git a/src/Annotator.js b/src/Annotator.js index 204c7e981..cb336295a 100644 --- a/src/Annotator.js +++ b/src/Annotator.js @@ -13,7 +13,8 @@ import { STATES, THREAD_EVENT, ANNOTATOR_EVENT, - CONTROLLER_EVENT + CONTROLLER_EVENT, + CLASS_ANNOTATIONS_LOADED } from './constants'; class Annotator extends EventEmitter { @@ -149,6 +150,7 @@ class Annotator extends EventEmitter { .then(() => { this.generateThreadMap(this.threadMap); this.render(); + this.annotatedElement.classList.add(CLASS_ANNOTATIONS_LOADED); }) .catch((error) => { this.emit(ANNOTATOR_EVENT.loadError, error); diff --git a/src/constants.js b/src/constants.js index ea11687c1..4c93ded7a 100644 --- a/src/constants.js +++ b/src/constants.js @@ -26,12 +26,16 @@ export const SELECTOR_ANNOTATION_BUTTON_POINT = `.${CLASS_ANNOTATION_BUTTON_POIN export const CLASS_ANNOTATION_BUTTON_DRAW_ENTER = 'bp-btn-annotate-draw-enter'; export const SELECTOR_ANNOTATION_BUTTON_DRAW_ENTER = `.${CLASS_ANNOTATION_BUTTON_DRAW_ENTER}`; +export const CLASS_BOX_PREVIEW = 'bp'; +export const SELECTOR_BOX_PREVIEW = `.${CLASS_BOX_PREVIEW}`; export const CLASS_PREVIEW_PRESENTATION = 'bp-doc-presentation'; export const SELECTOR_PREVIEW_PRESENTATION = `.${CLASS_PREVIEW_PRESENTATION}`; // Annotation CSS constants export const CLASS_ANNOTATED_ELEMENT = 'annotated-element'; export const SELECTOR_ANNOTATED_ELEMENT = `.${CLASS_ANNOTATED_ELEMENT}`; +export const CLASS_ANNOTATIONS_LOADED = 'ba-annotations-loaded'; +export const SELECTOR_ANNOTATIONS_LOADED = `.${CLASS_ANNOTATIONS_LOADED}`; export const CLASS_ANNOTATION_POINT_MARKER = 'ba-point-annotation-marker'; export const SELECTOR_ANNOTATION_POINT_MARKER = `.${CLASS_ANNOTATION_POINT_MARKER}`; export const CLASS_ANNOTATION_POINT_BUTTON = 'ba-point-annotation-btn';