Skip to content

Commit

Permalink
Fix: Adding reply-container mobile padding + clearing currentAnnotati…
Browse files Browse the repository at this point in the history
…onMode on mode exit (#370)

* Fix: Add reply-container bottom padding for all mobile devices
* Fix: Ensure this.currentAnnotationMode is set to null on mode exit
  • Loading branch information
pramodsum authored Sep 7, 2017
1 parent d0781a9 commit 05d3662
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/lib/annotations/Annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class Annotator extends EventEmitter {
*/
disableAnnotationMode(mode, buttonEl) {
if (this.isInAnnotationMode(mode)) {
this.currentAnnotationMode = null;
this.emit(MODE_EXIT);
}

Expand Down
6 changes: 1 addition & 5 deletions src/lib/annotations/MobileAnnotator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ $tablet: "(min-width: 768px)";
}

.reply-container {
padding-bottom: 15px;

@media #{$tablet} {
padding-bottom: 45px;
}
padding-bottom: 45px;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/lib/annotations/__tests__/Annotator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ describe('lib/annotations/Annotator', () => {

describe('disableAnnotationMode()', () => {
beforeEach(() => {
annotator.currentAnnotationMode = TYPES.point;
stubs.isInMode = sandbox.stub(annotator, 'isInAnnotationMode').returns(false);
stubs.emit = sandbox.stub(annotator, 'emit');
stubs.unbindMode = sandbox.stub(annotator, 'unbindModeListeners');
Expand All @@ -393,6 +394,7 @@ describe('lib/annotations/Annotator', () => {
expect(stubs.unbindMode).to.be.calledWith(TYPES.point);
expect(stubs.bindDOM).to.be.called;
expect(annotator.annotatedElement).to.not.have.class(CLASS_ANNOTATION_MODE);
expect(annotator.currentAnnotationMode).to.be.null;
});

it('should deactivate point annotation mode button', () => {
Expand Down

0 comments on commit 05d3662

Please sign in to comment.