Skip to content

Commit

Permalink
chore(resin): Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingze Xiao committed Jun 29, 2020
1 parent 7d9c27c commit b31bcb9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/AnnotationControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class AnnotationControls {
/**
* Initialize the annotation controls with options.
*/
public init({ onEscape = noop, onRegionClick = noop, fileId = '' }: Options = {}): void {
public init({ onEscape = noop, onRegionClick = noop, fileId }: Options = {}): void {
if (this.hasInit) {
return;
}
Expand All @@ -188,7 +188,10 @@ export default class AnnotationControls {

groupElement.setAttribute('data-resin-feature', 'annotations');
regionButton.setAttribute('data-resin-target', 'highlightRegion');
regionButton.setAttribute('data-resin-file_id', fileId);
if (fileId) {
regionButton.setAttribute('data-resin-fileId', fileId);
}

regionButton.setAttribute('data-testid', 'bp-AnnotationsControls-regionBtn');

this.onEscape = onEscape;
Expand Down

0 comments on commit b31bcb9

Please sign in to comment.