I was just debugging modal.js and came across the following piece of code :
that.$element.find('.modal-dialog') // wait for modal to slide in
.one('bsTransitionEnd', function () {
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
my question is about the following line :
emulateTransitionEnd(Modal.TRANSITION_DURATION) :
What is that? A jQuery function? A custom function in bootstrap?
I googled about this function, but could barely find anything, I am guessing it's a custom bootstrap function. But then I don't see this function in my modal.js (a subset of bootstrap.js) at all .
I saw the following somewhere : link.
What is this emulateTransitionEnd
really ? And where is it defined and what is it doing ?
You can find the line I am talking about here : line 99 modal.js
It's a custom Bootstrap function declared here
https://github.com/twbs/bootstrap/blob/83bfff7f0765503b990b96c303eef67009e48d77/js/transition.js#L36
It's a functions that fires event (once) on $.support.transition.end
$.support.transition.end contains one of these events:
You can find more informations here
how to listen to the end of a bootstrap animation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With