diff --git a/src/lib/annotations/Annotator.js b/src/lib/annotations/Annotator.js
index d23ab8c54..2bfa807d6 100644
--- a/src/lib/annotations/Annotator.js
+++ b/src/lib/annotations/Annotator.js
@@ -2,15 +2,11 @@ import EventEmitter from 'events';
import autobind from 'autobind-decorator';
import AnnotationService from './AnnotationService';
import * as annotatorUtil from './annotatorUtil';
-import {
- CLASS_ACTIVE,
- CLASS_HIDDEN,
- SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_POINT,
- SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_DRAW
-} from '../constants';
import { ICON_CLOSE } from '../icons/icons';
import './Annotator.scss';
import {
+ CLASS_ACTIVE,
+ CLASS_HIDDEN,
DATA_TYPE_ANNOTATION_DIALOG,
CLASS_MOBILE_ANNOTATION_DIALOG,
CLASS_ANNOTATION_DIALOG,
@@ -59,6 +55,7 @@ class Annotator extends EventEmitter {
this.validationErrorEmitted = false;
this.isMobile = data.isMobile;
this.previewUI = data.previewUI;
+ this.modeButtons = data.modeButtons;
this.annotationModeHandlers = [];
}
@@ -223,7 +220,8 @@ class Annotator extends EventEmitter {
}
// Hide create annotations button if image is rotated
- const pointAnnotateButton = this.previewUI.getAnnotateButton(SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_POINT);
+ const pointButtonSelector = this.modeButtons[TYPES.point].selector;
+ const pointAnnotateButton = this.previewUI.getAnnotateButton(pointButtonSelector);
if (rotationAngle !== 0) {
annotatorUtil.hideElement(pointAnnotateButton);
@@ -251,7 +249,8 @@ class Annotator extends EventEmitter {
*/
togglePointAnnotationHandler(event = {}) {
this.destroyPendingThreads();
- const buttonEl = event.target || this.previewUI.getAnnotateButton(SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_POINT);
+ const pointButtonSelector = this.modeButtons[TYPES.point].selector;
+ const buttonEl = event.target || this.previewUI.getAnnotateButton(pointButtonSelector);
if (this.isInDrawMode()) {
this.toggleDrawAnnotationHandler();
@@ -294,7 +293,8 @@ class Annotator extends EventEmitter {
this.togglePointAnnotationHandler();
}
- const buttonEl = event.target || this.previewUI.getAnnotateButton(SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_DRAW);
+ const drawButtonSelector = this.modeButtons[TYPES.draw].selector;
+ const buttonEl = event.target || this.previewUI.getAnnotateButton(drawButtonSelector);
const postButtonEl = this.previewUI.getAnnotateButton(SELECTOR_ANNOTATION_BUTTON_DRAW_POST);
// Exit if in draw mode
diff --git a/src/lib/annotations/CommentBox.js b/src/lib/annotations/CommentBox.js
index 37d263650..5130f0230 100644
--- a/src/lib/annotations/CommentBox.js
+++ b/src/lib/annotations/CommentBox.js
@@ -1,5 +1,4 @@
import EventEmitter from 'events';
-import { CLASS_ACTIVE } from '../constants';
import * as constants from './annotationConstants';
import { hideElement, showElement } from './annotatorUtil';
@@ -178,7 +177,7 @@ class CommentBox extends EventEmitter {
const containerEl = document.createElement('section');
containerEl.classList.add('bp-create-highlight-comment');
containerEl.innerHTML = `
-