Skip to content

Commit

Permalink
Fix: Hide createHighlightDialog on page re-render (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum authored Nov 14, 2017
1 parent 08c180d commit 0b74717
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/doc/DocAnnotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ class DocAnnotator extends Annotator {
thread.destroy();
}
});

if (this.createHighlightDialog && this.createHighlightDialog.isVisible) {
this.createHighlightDialog.hide();
}
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/doc/__tests__/DocAnnotator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,17 @@ describe('doc/DocAnnotator', () => {

annotator.threads = {};
});

it('should clear and hide createHighlightDialog on page render', () => {
annotator.createHighlightDialog = {
isVisible: true,
hide: () => {},
destroy: () => {}
};
const createMock = sandbox.mock(annotator.createHighlightDialog);
createMock.expects('hide');
annotator.renderAnnotationsOnPage(1);
});
});

describe('scaleAnnotationCanvases()', () => {
Expand Down

0 comments on commit 0b74717

Please sign in to comment.