Skip to content

Commit

Permalink
feat(annotations): Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingze Xiao committed Mar 26, 2020
1 parent 69cc424 commit 2a55a7f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/AnnotationControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export const CLASS_ANNOTATIONS_GROUP = 'bp-AnnotationControls-group';
export const CLASS_REGION_BUTTON = 'bp-AnnotationControls-regionBtn';
export const CLASS_BUTTON_ACTIVE = 'is-active';

export type RegionHandlerType = ({ isRegionActive, event }: { isRegionActive: boolean; event: MouseEvent }) => void;
export type RegionHandler = ({ isRegionActive, event }: { isRegionActive: boolean; event: MouseEvent }) => void;
export type Options = {
onRegionClick?: RegionHandlerType;
onRegionClick?: RegionHandler;
};

declare const __: (key: string) => string;
Expand Down Expand Up @@ -37,11 +37,11 @@ export default class AnnotationControls {
/**
* Region comment button click handler
*
* @param {RegionHandlerType} onRegionClick - region click handler in options
* @param {RegionHandler} onRegionClick - region click handler in options
* @param {MouseEvent} event - mouse event
* @return {void}
*/
private handleRegionClick = (onRegionClick: RegionHandlerType) => (event: MouseEvent): void => {
private handleRegionClick = (onRegionClick: RegionHandler) => (event: MouseEvent): void => {
const regionButtonElement = event.target as HTMLButtonElement;

this.isRegionActive = !this.isRegionActive;
Expand All @@ -57,7 +57,7 @@ export default class AnnotationControls {
/**
* Initialize the annotation controls with options.
*
* @param {RegionHandlerType} [options.onRegionClick] - Callback when region comment button is clicked
* @param {RegionHandler} [options.onRegionClick] - Callback when region comment button is clicked
* @return {void}
*/
public init({ onRegionClick = noop }: Options = {}): void {
Expand Down

0 comments on commit 2a55a7f

Please sign in to comment.