Skip to content

Conversation

@gibson042
Copy link
Member

Fixes gh-3449

@mention-bot
Copy link

@gibson042, thanks for your PR! By analyzing the history of the files in this pull request, we identified @timmywil, @jbedard and @markelog to be potential reviewers.

src/offset.js Outdated
var win = getWindow( elem );

// Coalesce documents and windows
var win = jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe if..else instead of ternary... please 😇

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

src/offset.js Outdated
if ( jQuery.isWindow( elem ) ) {
win = elem;
} else {
win = elem.nodeType === 9 && elem.defaultView;
Copy link
Member

Choose a reason for hiding this comment

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

Yeysies

src/offset.js Outdated
if ( jQuery.isWindow( elem ) ) {
win = elem;
} else {
win = elem.nodeType === 9 && elem.defaultView;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the nodeType check could be moved into the else? That would make it even less hacky.

Copy link
Member Author

Choose a reason for hiding this comment

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

D'oh, good call.

@gibson042 gibson042 merged commit bf3a43e into jquery:master Dec 19, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants