Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Search preview container for mobile annotations dialog #209

Merged
merged 2 commits into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lib/annotations/AnnotationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const CLASS_ANIMATE_DIALOG = 'bp-animate-show-dialog';
super();

this.annotatedElement = data.annotatedElement;
this.container = data.container;
this.location = data.location;
this.hasAnnotations = data.annotations.length > 0;
this.canAnnotate = data.canAnnotate;
Expand Down Expand Up @@ -68,7 +69,7 @@ const CLASS_ANIMATE_DIALOG = 'bp-animate-show-dialog';
show() {
// Populate mobile annotations dialog with annotations information
if (this.isMobile) {
this.element = this.annotatedElement.querySelector(`.${constants.CLASS_MOBILE_ANNOTATION_DIALOG}`);
this.element = this.container.querySelector(`.${constants.CLASS_MOBILE_ANNOTATION_DIALOG}`);
annotatorUtil.showElement(this.element);
this.element.appendChild(this.dialogEl);

Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/AnnotationThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { ICON_PLACED_ANNOTATION } from '../icons/icons';
this.annotatedElement = data.annotatedElement;
this.annotations = data.annotations || [];
this.annotationService = data.annotationService;
this.container = data.container;
this.fileVersionId = data.fileVersionId;
this.location = data.location;
this.threadID = data.threadID || AnnotationService.generateID();
Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/__tests__/AnnotationDialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('lib/annotations/AnnotationDialog', () => {

dialog = new AnnotationDialog({
annotatedElement: document.querySelector('.annotated-element'),
container: document,
location: {},
annotations: [],
canAnnotate: true
Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/doc/DocAnnotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ function isThreadInHoverState(thread) {
annotatedElement: this.annotatedElement,
annotations,
annotationService: this.annotationService,
container: this.container,
fileVersionId: this.fileVersionId,
isMobile: this.isMobile,
locale: this.locale,
Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/doc/DocHighlightThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ const HOVER_TIMEOUT_MS = 75;
createDialog() {
this.dialog = new DocHighlightDialog({
annotatedElement: this.annotatedElement,
container: this.container,
annotations: this.annotations,
locale: this.locale,
location: this.location,
Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/doc/DocPointThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const POINT_ANNOTATION_ICON_WIDTH = 24;
createDialog() {
this.dialog = new DocPointDialog({
annotatedElement: this.annotatedElement,
container: this.container,
annotations: this.annotations,
locale: this.locale,
location: this.location,
Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/image/ImageAnnotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const ANNOTATED_ELEMENT_SELECTOR = '.bp-image, .bp-images-wrapper';
annotatedElement: this.annotatedElement,
annotations,
annotationService: this.annotationService,
container: this.container,
fileVersionId: this.fileVersionId,
isMobile: this.isMobile,
locale: this.locale,
Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/image/ImagePointThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const POINT_ANNOTATION_ICON_WIDTH = 24;
createDialog() {
this.dialog = new ImagePointDialog({
annotatedElement: this.annotatedElement,
container: this.container,
annotations: this.annotations,
location: this.location,
locale: this.locale,
Expand Down