From b4a3b00ac8635b51b6216f540ac59219432c0d65 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 11 Jun 2018 21:44:21 +0200 Subject: [PATCH] fix(event-handler): remove polyfill and move it to index --- js/src/dom/eventHandler.js | 14 -------------- js/src/index.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/js/src/dom/eventHandler.js b/js/src/dom/eventHandler.js index dda1eb216f..25248fb92f 100644 --- a/js/src/dom/eventHandler.js +++ b/js/src/dom/eventHandler.js @@ -307,18 +307,4 @@ const EventHandler = (() => { } })() -// focusin and focusout polyfill -if (Polyfill.focusIn) { - (() => { - function listenerFocus(event) { - EventHandler.trigger(event.target, 'focusin') - } - function listenerBlur(event) { - EventHandler.trigger(event.target, 'focusout') - } - EventHandler.on(document, 'focus', 'input', listenerFocus) - EventHandler.on(document, 'blur', 'input', listenerBlur) - })() -} - export default EventHandler diff --git a/js/src/index.js b/js/src/index.js index aa35ed07b3..0c662873df 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -3,7 +3,9 @@ import Button from './button' import Carousel from './carousel' import Collapse from './collapse' import Dropdown from './dropdown' +import EventHandler from './dom/eventHandler' import Modal from './modal' +import Polyfill from './dom/polyfill' import Popover from './popover' import ScrollSpy from './scrollspy' import Tab from './tab' @@ -18,6 +20,21 @@ import Util from './util' * -------------------------------------------------------------------------- */ +/* istanbul ignore next */ +// focusin and focusout polyfill +if (Polyfill.focusIn) { + (() => { + function listenerFocus(event) { + EventHandler.trigger(event.target, 'focusin') + } + function listenerBlur(event) { + EventHandler.trigger(event.target, 'focusout') + } + EventHandler.on(document, 'focus', 'input', listenerFocus) + EventHandler.on(document, 'blur', 'input', listenerBlur) + })() +} + export { Util, Alert,