From 6ba3811b3fa982598fcf3502f5470613b90f76a7 Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sun, 22 Oct 2017 22:25:02 -0700 Subject: [PATCH] use listenDOM --- core/emitter.js | 2 +- themes/base.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/emitter.js b/core/emitter.js index 06e3d8f49d..5814f127c1 100644 --- a/core/emitter.js +++ b/core/emitter.js @@ -3,7 +3,7 @@ import logger from './logger'; let debug = logger('quill:events'); -const EVENTS = ['selectionchange', 'mousedown', 'mouseup']; +const EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; EVENTS.forEach(function(eventName) { document.addEventListener(eventName, (...args) => { diff --git a/themes/base.js b/themes/base.js index 16e1949c79..c88bbe9f35 100644 --- a/themes/base.js +++ b/themes/base.js @@ -45,7 +45,7 @@ class BaseTheme extends Theme { }); } }; - document.body.addEventListener('click', listener); + quill.emitter.listenDOM('click', document.body, listener); } addModule(name) {