diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index f5271817a..00b5e6bf7 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -587,6 +587,9 @@ class BaseViewer extends EventEmitter { if (this.annotator && this.areNewAnnotationsEnabled()) { this.annotator.emit(ANNOTATOR_EVENT.setVisibility, true); + if (this.options.enableAnnotationsDiscoverability) { + this.annotator.toggleAnnotationMode(AnnotationMode.REGION); + } this.enableAnnotationControls(); } } diff --git a/src/lib/viewers/__tests__/BaseViewer-test.js b/src/lib/viewers/__tests__/BaseViewer-test.js index 536ecd163..ab8faddda 100644 --- a/src/lib/viewers/__tests__/BaseViewer-test.js +++ b/src/lib/viewers/__tests__/BaseViewer-test.js @@ -583,6 +583,25 @@ describe('lib/viewers/BaseViewer', () => { expect(base.annotator.emit).to.be.calledWith(ANNOTATOR_EVENT.setVisibility, true); expect(base.enableAnnotationControls).to.be.called; }); + + it(`should show annotations and toggle annotations mode to REGION if enableAnnotationsDiscoverability is true`, () => { + sandbox.stub(base, 'areNewAnnotationsEnabled').returns(true); + sandbox.stub(base, 'enableAnnotationControls'); + base.annotator = { + emit: sandbox.mock(), + toggleAnnotationMode: sandbox.mock(), + }; + base.annotationControls = { + destroy: sandbox.mock(), + }; + base.options.enableAnnotationsDiscoverability = true; + + base.handleFullscreenExit(); + + expect(base.annotator.emit).to.be.calledWith(ANNOTATOR_EVENT.setVisibility, true); + expect(base.enableAnnotationControls).to.be.called; + expect(base.annotator.toggleAnnotationMode).to.be.calledWith(AnnotationMode.REGION); + }); }); describe('resize()', () => {