Skip to content

Commit

Permalink
Chore: Force image point dialogs to re-position on re-render (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum authored Aug 7, 2017
1 parent a02f3fe commit baf9b70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/annotations/image/ImagePointThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class ImagePointThread extends AnnotationThread {

if (this.state === STATES.pending) {
this.showDialog();

// Force dialogs to reposition on re-render
this.dialog.position();
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/lib/annotations/image/__tests__/ImagePointThread-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ describe('lib/annotations/image/ImagePointThread', () => {
threadID: 2,
type: 'point'
});

thread.dialog = {
position: sandbox.stub()
};
});

afterEach(() => {
Expand Down Expand Up @@ -55,6 +59,7 @@ describe('lib/annotations/image/ImagePointThread', () => {
thread.show();

expect(thread.showDialog).to.have.been.called;
expect(thread.dialog.position).to.have.been.called;
});

it('should not show the dialog if the state is not pending', () => {
Expand Down

0 comments on commit baf9b70

Please sign in to comment.