Skip to content

Position: Guard against passing window to offset #1565

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

Closed
wants to merge 1 commit into from

Conversation

arschmitz
Copy link
Member

Starting in jQuery 3.0 this will throw an error

return {
element: withinElement,
isWindow: isWindow,
isDocument: isDocument,
offset: withinElement.offset() || { left: 0, top: 0 },
offset: hasOffset ? $( element ).offset() || false : false || { left: 0, top: 0 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the || false? That looks like it guards against the reverted change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what's with the false ||?

And why isn't this using withinElement anymore?

@arschmitz
Copy link
Member Author

This needs another review

@jzaefferer
Copy link
Member

Reviewed!

Starting in jQuery 3.0 this will throw an error
@arschmitz
Copy link
Member Author

Fixed last comment

@jzaefferer
Copy link
Member

Looks good.

1 similar comment
@scottgonzalez
Copy link
Member

Looks good.

@jzaefferer
Copy link
Member

Merge it!

@arschmitz arschmitz closed this in b3a9b13 Jul 8, 2015
scottgonzalez pushed a commit that referenced this pull request Jun 9, 2016
Starting in jQuery 3.0 this will throw an error

Fixes #13493
Closes gh-1565

(cherry picked from commit b3a9b13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants