Skip to content

Commit

Permalink
Chore: Add .ba-annotations-loaded to preview when load completes
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum committed Apr 12, 2018
1 parent baf4ebc commit b9c323b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
STATES,
THREAD_EVENT,
ANNOTATOR_EVENT,
CONTROLLER_EVENT
CONTROLLER_EVENT,
CLASS_ANNOTATIONS_LOADED
} from './constants';

class Annotator extends EventEmitter {
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit b9c323b

Please sign in to comment.