1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 13:59:06 +02:00

move util in a util folder with the sanitizer

This commit is contained in:
Johann-S
2019-02-23 00:37:55 +02:00
committed by XhmikosR
parent 8affe84c72
commit 8a37045b79
34 changed files with 559 additions and 589 deletions

View File

@@ -5,10 +5,16 @@
* --------------------------------------------------------------------------
*/
import {
jQuery as $,
TRANSITION_END,
emulateTransitionEnd,
getSelectorFromElement,
getTransitionDurationFromElement
} from './util/index'
import Data from './dom/data'
import EventHandler from './dom/eventHandler'
import SelectorEngine from './dom/selectorEngine'
import Util from './util'
/**
* ------------------------------------------------------------------------
@@ -83,7 +89,7 @@ class Alert {
// Private
_getRootElement(element) {
const selector = Util.getSelectorFromElement(element)
const selector = getSelectorFromElement(element)
let parent = false
if (selector) {
@@ -109,11 +115,11 @@ class Alert {
return
}
const transitionDuration = Util.getTransitionDurationFromElement(element)
const transitionDuration = getTransitionDurationFromElement(element)
EventHandler
.one(element, Util.TRANSITION_END, (event) => this._destroyElement(element, event))
Util.emulateTransitionEnd(element, transitionDuration)
.one(element, TRANSITION_END, (event) => this._destroyElement(element, event))
emulateTransitionEnd(element, transitionDuration)
}
_destroyElement(element) {
@@ -170,7 +176,6 @@ EventHandler
* add .alert to jQuery only if jQuery is present
*/
const $ = Util.jQuery
if (typeof $ !== 'undefined') {
const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME] = Alert._jQueryInterface