0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-30 22:52:24 +01:00

fix(event-handler): remove polyfill and move it to index

This commit is contained in:
Johann-S 2018-06-11 21:44:21 +02:00 committed by XhmikosR
parent fe580a8e5a
commit b4a3b00ac8
2 changed files with 17 additions and 14 deletions

View File

@ -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 export default EventHandler

View File

@ -3,7 +3,9 @@ import Button from './button'
import Carousel from './carousel' import Carousel from './carousel'
import Collapse from './collapse' import Collapse from './collapse'
import Dropdown from './dropdown' import Dropdown from './dropdown'
import EventHandler from './dom/eventHandler'
import Modal from './modal' import Modal from './modal'
import Polyfill from './dom/polyfill'
import Popover from './popover' import Popover from './popover'
import ScrollSpy from './scrollspy' import ScrollSpy from './scrollspy'
import Tab from './tab' 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 { export {
Util, Util,
Alert, Alert,