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 dbba2b7 commit a1ba9ae
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/lib/AnnotationControls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
padding: 0 4px 0 8px;
border-left: 1px solid $twos;

& .bp-AnnotationControls-regionBtn {
width: 32px;
height: 32px;
.bp-AnnotationControls-regionBtn {
width: $controls-button-width;
height: $controls-button-width;
border-radius: 4px;

svg {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/AnnotationControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export type Options = {
onRegionClick?: Function;
};

declare const __: (key: string) => string;

export default class AnnotationControls {
/** @property {Controls} - Controls object */
private controls: Controls;
Expand Down Expand Up @@ -60,8 +62,6 @@ export default class AnnotationControls {
public init({ onRegionClick = noop }: Options = {}): void {
const groupElement = this.controls.addGroup(CLASS_ANNOTATIONS_GROUP);
this.controls.add(
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
__('region_comment'),
this.handleRegionClick(onRegionClick),
`${CLASS_BOX_CONTROLS_GROUP_BUTTON} ${CLASS_REGION_BUTTON}`,
Expand Down
7 changes: 6 additions & 1 deletion src/lib/Controls.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
$controls-button-width: 32px;

@import './AnnotationControls';
@import './ZoomControls';

.bp-controls-wrapper {
position: absolute;
bottom: 25px;
Expand Down Expand Up @@ -166,7 +171,7 @@
margin-left: 4px;

.bp-controls-group-btn {
width: 32px;
width: $controls-button-width;
}

& + .bp-controls-cell {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/Preview.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@import 'common';
@import 'loading';
@import 'navigation';
@import './AnnotationControls';
@import './Controls';
@import './ProgressBar';
@import './VirtualScroller';
@import './ZoomControls';
3 changes: 0 additions & 3 deletions src/lib/icons/annotation_region_comment.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/icons/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import FULLSCREEN_OUT from './full_screen_out_24px.svg';
import ROTATE_LEFT from './rotate_left_24px.svg';
import ZOOM_IN from './zoom_in.svg';
import ZOOM_OUT from './zoom_out.svg';
import REGION_COMMENT from './annotation_region_comment.svg';
import REGION_COMMENT from './region_comment.svg';
import ARROW_LEFT from './arrow_left_24px.svg';
import ARROW_RIGHT from './arrow_right_24px.svg';
import CHECK_MARK from './checkmark_24px.svg';
Expand Down
1 change: 1 addition & 0 deletions src/lib/icons/region_comment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/lib/viewers/doc/DocBaseViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ class DocBaseViewer extends BaseViewer {
this.pinchToZoomEndHandler = this.pinchToZoomEndHandler.bind(this);
this.pinchToZoomStartHandler = this.pinchToZoomStartHandler.bind(this);
this.print = this.print.bind(this);
this.regionClickHandler = this.regionClickHandler.bind(this);
this.setPage = this.setPage.bind(this);
this.throttledScrollHandler = this.getScrollHandler().bind(this);
this.toggleThumbnails = this.toggleThumbnails.bind(this);
this.zoomIn = this.zoomIn.bind(this);
this.zoomOut = this.zoomOut.bind(this);
this.regionClickHandler = this.regionClickHandler.bind(this);
}

/**
Expand Down

0 comments on commit a1ba9ae

Please sign in to comment.