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

animationComplete: The context is sometimes an element, sometimes a jQuery object #7916

Closed
gabrielschulhof opened this Issue Jan 14, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@gabrielschulhof
Contributor

gabrielschulhof commented Jan 14, 2015

Steps to reproduce:

  1. Go to http://jsbin.com/subowa/9/
  2. Open the console
  3. Click on "Pop"
  4. Notice that the context of .animationComplete() is an element
  5. Close the popup
  6. Notice that the context of .animationComplete() is a jQuery object
@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jan 14, 2015

Contributor

The event handler provides an element as the context, whereas the timeout provides a jQuery object as the context.

The context should be whatever .animationComplete() was called on.

Contributor

gabrielschulhof commented Jan 14, 2015

The event handler provides an element as the context, whereas the timeout provides a jQuery object as the context.

The context should be whatever .animationComplete() was called on.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jan 15, 2015

Contributor

OK, it's better to behave like an event handler and pass an element as the context. Also, as it stands, the callback will be called even on an empty jQuery object (which makes no sense): http://jsbin.com/tubupu/1/

Contributor

gabrielschulhof commented Jan 15, 2015

OK, it's better to behave like an event handler and pass an element as the context. Also, as it stands, the callback will be called even on an empty jQuery object (which makes no sense): http://jsbin.com/tubupu/1/

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Jan 15, 2015

@gabrielschulhof gabrielschulhof added this to the 1.5.0 milestone Jan 15, 2015

kakul added a commit to kakul/jquery-mobile that referenced this issue Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment