From 5900ece40f7b78e30af1b95c08c124098bce7c2c Mon Sep 17 00:00:00 2001 From: Sumedha Pramod Date: Fri, 18 Aug 2017 10:37:09 -0700 Subject: [PATCH] Fix: Re-showing viewer controls on 'annotationmodeexit' (#323) --- src/lib/viewers/BaseViewer.js | 5 +---- src/lib/viewers/__tests__/BaseViewer-test.js | 13 +------------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index 2d1f3320d..0e1489ec2 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -727,10 +727,7 @@ class BaseViewer extends EventEmitter { } break; case ANNOTATION_MODE_EXIT: - if (!this.annotator.isInAnnotationMode(ANNOTATION_TYPE_POINT)) { - this.enableViewerControls(); - } - + this.enableViewerControls(); this.emit('notificationhide'); break; case 'annotationerror': diff --git a/src/lib/viewers/__tests__/BaseViewer-test.js b/src/lib/viewers/__tests__/BaseViewer-test.js index a34fdb17b..0bf267a84 100644 --- a/src/lib/viewers/__tests__/BaseViewer-test.js +++ b/src/lib/viewers/__tests__/BaseViewer-test.js @@ -857,19 +857,8 @@ describe('lib/viewers/BaseViewer', () => { expect(base.emit).to.be.calledWith('notificationshow', sinon.match.string); }); - it('should hide notification on annotationmodeexit', () => { + it('should enable controls and hide notification on annotationmodeexit', () => { sandbox.stub(base, 'enableViewerControls'); - stubs.isInAnnotationMode.returns(true); - base.handleAnnotatorNotifications({ - event: ANNOTATION_MODE_EXIT - }); - expect(base.enableViewerControls).to.not.be.called; - expect(base.emit).to.be.calledWith('notificationhide'); - }); - - it('should enable controls if not in point annotation mode on annotationmodeexit', () => { - sandbox.stub(base, 'enableViewerControls'); - stubs.isInAnnotationMode.returns(false); base.handleAnnotatorNotifications({ event: ANNOTATION_MODE_EXIT });