Commit 8d34bc13 authored by Johann-S's avatar Johann-S Committed by XhmikosR
Browse files

Move transition end detection to dom/event.js instead of util.js

parent fb465c47
5 merge requests!31948Examples/Floating-labels: fix bad behavior with autofill,!30064test,!29779Responsive sizing,!28882fix custom-select-indicator in IE10,!28721Hot test
Showing with 0 additions and 40 deletions
+0 -40
...@@ -22,46 +22,6 @@ function toType(obj) { ...@@ -22,46 +22,6 @@ function toType(obj) {
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
} }
function getSpecialTransitionEndEvent() {
return {
bindType: TRANSITION_END,
delegateType: TRANSITION_END,
handle(event) {
if ($(event.target).is(this)) {
return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params
}
return undefined // eslint-disable-line no-undefined
}
}
}
function transitionEndEmulator(duration) {
let called = false
$(this).one(Util.TRANSITION_END, () => {
called = true
})
setTimeout(() => {
if (!called) {
Util.triggerTransitionEnd(this)
}
}, duration)
return this
}
function setTransitionEndSupport() {
$.fn.emulateTransitionEnd = transitionEndEmulator
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()
}
/**
* --------------------------------------------------------------------------
* Public Util Api
* --------------------------------------------------------------------------
*/
const Util = { const Util = {
TRANSITION_END: 'bsTransitionEnd', TRANSITION_END: 'bsTransitionEnd',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment