From 526839420800e1539830675b2728e2135ab32c17 Mon Sep 17 00:00:00 2001 From: Mick Ryan Date: Fri, 22 May 2020 18:29:53 -0700 Subject: [PATCH] fix(controls): update region annotation icon * Remove un-needed class --- src/lib/AnnotationControls.ts | 4 ++-- src/lib/Controls.js | 2 +- src/lib/__tests__/AnnotationControls-test.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/AnnotationControls.ts b/src/lib/AnnotationControls.ts index 8337edb2c..c87125d31 100644 --- a/src/lib/AnnotationControls.ts +++ b/src/lib/AnnotationControls.ts @@ -1,7 +1,7 @@ import noop from 'lodash/noop'; import { ICON_REGION_COMMENT } from './icons/icons'; -import Controls, { CONTROLS_BUTTON_CLASS } from './Controls'; +import Controls from './Controls'; import fullscreen from './Fullscreen'; export const CLASS_ANNOTATIONS_GROUP = 'bp-AnnotationControls-group'; @@ -153,7 +153,7 @@ export default class AnnotationControls { const regionButton = this.controls.add( __('region_comment'), this.handleClick(onRegionClick, AnnotationMode.REGION), - `${CONTROLS_BUTTON_CLASS} ${CLASS_REGION_BUTTON}`, + CLASS_REGION_BUTTON, ICON_REGION_COMMENT, 'button', groupElement, diff --git a/src/lib/Controls.js b/src/lib/Controls.js index 79f9470a7..0ddf3c8fa 100644 --- a/src/lib/Controls.js +++ b/src/lib/Controls.js @@ -3,7 +3,7 @@ import Browser from './Browser'; import { CLASS_HIDDEN } from './constants'; const SHOW_PREVIEW_CONTROLS_CLASS = 'box-show-preview-controls'; -export const CONTROLS_BUTTON_CLASS = 'bp-controls-btn'; +const CONTROLS_BUTTON_CLASS = 'bp-controls-btn'; const CONTROLS_PAGE_NUM_INPUT_CLASS = 'bp-page-num-input'; const CONTROLS_PAGE_NUM_WRAPPER_CLASS = 'bp-page-num-wrapper'; const CONTROLS_AUTO_HIDE_TIMEOUT_IN_MILLIS = 2000; diff --git a/src/lib/__tests__/AnnotationControls-test.js b/src/lib/__tests__/AnnotationControls-test.js index 9b5459331..47c9b3b50 100644 --- a/src/lib/__tests__/AnnotationControls-test.js +++ b/src/lib/__tests__/AnnotationControls-test.js @@ -7,7 +7,7 @@ import AnnotationControls, { CLASS_GROUP_HIDE, CLASS_REGION_BUTTON, } from '../AnnotationControls'; -import Controls, { CONTROLS_BUTTON_CLASS } from '../Controls'; +import Controls from '../Controls'; import fullscreen from '../Fullscreen'; let annotationControls; @@ -89,7 +89,7 @@ describe('lib/AnnotationControls', () => { expect(annotationControls.controls.add).to.be.calledWith( __('region_comment'), stubs.regionHandler, - `${CONTROLS_BUTTON_CLASS} ${CLASS_REGION_BUTTON}`, + CLASS_REGION_BUTTON, ICON_REGION_COMMENT, 'button', sinon.match.any,