-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Offset: Eliminate little-used internal function #3456
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
Conversation
|
@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; |
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.
Maybe if..else instead of ternary... please 😇
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.
Done.
src/offset.js
Outdated
| if ( jQuery.isWindow( elem ) ) { | ||
| win = elem; | ||
| } else { | ||
| win = elem.nodeType === 9 && elem.defaultView; |
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.
Yeysies
src/offset.js
Outdated
| if ( jQuery.isWindow( elem ) ) { | ||
| win = elem; | ||
| } else { | ||
| win = elem.nodeType === 9 && elem.defaultView; |
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.
Maybe the nodeType check could be moved into the else? That would make it even less hacky.
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.
D'oh, good call.
Fixes gh-3449