diff --git a/src/AnnotationThread.js b/src/AnnotationThread.js index 2c2f89d3e..060509ebb 100644 --- a/src/AnnotationThread.js +++ b/src/AnnotationThread.js @@ -65,10 +65,6 @@ class AnnotationThread extends EventEmitter { // Explicitly bind listeners this.showDialog = this.showDialog.bind(this); - if (!this.isMobile) { - this.mouseoutHandler = this.mouseoutHandler.bind(this); - } - this.setup(); } @@ -549,26 +545,6 @@ class AnnotationThread extends EventEmitter { return indicatorEl; } - /** - * Mouseout handler. Hides dialog if we aren't creating the first one. - * - * @private - * @param {HTMLEvent} event - DOM event - * @return {void} - */ - mouseoutHandler(event) { - if (!event) { - return; - } - - const mouseInDialog = util.isInDialog(event, event.toElement); - - const firstAnnotation = util.getFirstAnnotation(this.annotations); - if (firstAnnotation && !mouseInDialog) { - this.hideDialog(); - } - } - /** * Saves the provided annotation to the thread and dialog if appropriate * and resets state to inactive. diff --git a/src/__tests__/AnnotationThread-test.js b/src/__tests__/AnnotationThread-test.js index f89343c92..cd9e1a97b 100644 --- a/src/__tests__/AnnotationThread-test.js +++ b/src/__tests__/AnnotationThread-test.js @@ -681,38 +681,6 @@ describe('AnnotationThread', () => { }); }); - // describe('mouseoutHandler()', () => { - // it('should do nothing if event does not exist', () => { - // util.isInDialog = jest.fn(); - // thread.mouseoutHandler(); - // expect(util.isInDialog).not.toBeCalled(); - // }); - - // it('should not call hideDialog if there are no annotations in the thread', () => { - // thread.annotations = []; - // thread.hideDialog = jest.fn(); - // thread.mouseoutHandler({}); - // expect(thread.hideDialog).not.toBeCalled(); - // }); - - // it('should call hideDialog if there are annotations in the thread', () => { - // thread.hideDialog = jest.fn(); - // const annotation = new Annotation({ - // fileVersionId: '2', - // threadID: '1', - // type: 'point', - // text: 'blah', - // threadNumber: '1', - // location: { x: 0, y: 0 }, - // created: Date.now() - // }); - - // thread.annotations = [annotation]; - // thread.mouseoutHandler({}); - // expect(thread.hideDialog).toBeCalled(); - // }); - // }); - describe('saveAnnotationToThread()', () => { it('should add the annotation to the thread, and add to the dialog when the dialog exists', () => { thread.annotations.push = jest.fn();