-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add special transitionend type to test event origin #13786
Conversation
|
||
$.event.special['bs-transitionend'] = { | ||
bindType: $.support.transition.end, | ||
delegateType: $.support.transition.end, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be more like ($.support.transition && $.support.transition.end) || false
for it to be null safe? Also, does jQuery care if these are false
?
Edit: Or we could wrap this in a conditional to check if transitions are supported
Did you discard the idea of it also handling the |
Also, I dislike the dash, but camel-casing events is also weird... Never mind then. |
Yeah, i decided it was probably best not to throw everything into a single function - thought your original proposal was more elegant/flexible.
Yeah not super crazy about the dash either but wanted to namespace somehow… actually i think camel-casing is a better idea. More inline with vender prefix's like |
|
||
if (!$.support.transition.end) return | ||
|
||
$.event.special['bsTransitionEnd'] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use dot notation then.
|
@@ -48,6 +48,16 @@ | |||
|
|||
$(function () { | |||
$.support.transition = transitionEnd() | |||
|
|||
if (!$.support.transition.end) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha - no it was good, made me find a bug
|
word, that's what i was thinking |
lg? |
$(this).one($.support.transition.end, function () { called = true }) | ||
var callback = function () { if (!called) $($el).trigger($.support.transition.end) } | ||
$(this).one('bsTransitionEnd', function () { called = true }) | ||
var callback = function () { if (!called) $($el).trigger(`.end) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here?
Add a unit test perhaps? |
ya good call |
erm… can't add unit test because we set transitions to false in unit tests |
We could set it to |
Because transitionEnd is private to the transition method, we have no way to determine the transitionend and force the i'm going to merge this, if you want to hack up a way to unit test it though, that would be rad… just a bit of a pita |
add special transitionend type to test event origin
fixes #13430