diff --git a/src/MobileAnnotator.scss b/src/MobileAnnotator.scss index b3476ff1a..46dcac8fc 100644 --- a/src/MobileAnnotator.scss +++ b/src/MobileAnnotator.scss @@ -187,7 +187,7 @@ } .ba-mobile-annotation-dialog .ba-annotation-highlight-btns, -.ba-mobile-annotation-dialog .bp-create-comment, +.ba-mobile-annotation-dialog .ba-create-comment, .ba-mobile-annotation-dialog .annotation-container section[data-section="create"], .ba-mobile-create-annotation-dialog { background: white; @@ -247,7 +247,7 @@ } } -.bp-container .bp-annotate-draw-undo-redo-container { +.bp-container .ba-draw-undo-redo-container { margin: 0; @media #{$tablet} { diff --git a/src/doc/DocAnnotator.js b/src/doc/DocAnnotator.js index 6f2f48b0e..067acd7cf 100644 --- a/src/doc/DocAnnotator.js +++ b/src/doc/DocAnnotator.js @@ -488,7 +488,7 @@ class DocAnnotator extends Annotator { */ resetHighlightSelection(event) { const isCreateDialogVisible = this.createHighlightDialog && this.createHighlightDialog.isVisible; - if (!isCreateDialogVisible || util.isInDialog(event)) { + if (!isCreateDialogVisible || !event || util.isInDialog(event)) { return; } @@ -852,7 +852,7 @@ class DocAnnotator extends Annotator { this.highlighter.removeAllHighlights(); } - this.resetHighlightSelection(); + this.resetHighlightSelection(event); this.isCreatingHighlight = false; // Prevent the creation of highlights if the user is currently creating a point annotation @@ -1026,7 +1026,7 @@ class DocAnnotator extends Annotator { switch (data.event) { case CONTROLLER_EVENT.toggleMode: - this.resetHighlightSelection(); + this.resetHighlightSelection(data.event); break; case CONTROLLER_EVENT.bindDOMListeners: if (isCreateDialogVisible) { diff --git a/src/doc/__tests__/DocAnnotator-test.js b/src/doc/__tests__/DocAnnotator-test.js index 22daed135..6613e237e 100644 --- a/src/doc/__tests__/DocAnnotator-test.js +++ b/src/doc/__tests__/DocAnnotator-test.js @@ -836,7 +836,7 @@ describe('doc/DocAnnotator', () => { }); it('should do nothing if the createHighlightDialog is hidden', () => { - annotator.resetHighlightSelection(); + annotator.resetHighlightSelection({}); expect(annotator.createHighlightDialog.hide).to.not.be.called; }); @@ -848,7 +848,7 @@ describe('doc/DocAnnotator', () => { it('hide the visible createHighlightDialog and clear the text selection', () => { annotator.createHighlightDialog.isVisible = true; - annotator.resetHighlightSelection(); + annotator.resetHighlightSelection({}); expect(annotator.createHighlightDialog.hide).to.be.called; }); });