Skip to content

Commit

Permalink
Fix: Re-showing viewer controls on 'annotationmodeexit' (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum committed Aug 18, 2017
1 parent 5dc3247 commit 5900ece
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
5 changes: 1 addition & 4 deletions src/lib/viewers/BaseViewer.js
Expand Up @@ -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':
Expand Down
13 changes: 1 addition & 12 deletions src/lib/viewers/__tests__/BaseViewer-test.js
Expand Up @@ -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
});
Expand Down

0 comments on commit 5900ece

Please sign in to comment.