Skip to content
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

Only move tethered element if its offset parent is not the body #98

Merged
merged 1 commit into from
Jul 15, 2015

Conversation

pzuraq
Copy link

@pzuraq pzuraq commented Jul 15, 2015

In response to discussion in #96.

@zackbloom

@adamschwartz adamschwartz changed the title Only move tethered element if it's offset parent is not the body Only move tethered element if its offset parent is not the body Jul 15, 2015
if(!moved && this.element.parentNode.tagName !== 'BODY') {
let offsetParentIsBody = true;
let currentNode = this.element.parentNode;
while (currentNode && currentNode.tagName !== 'BODY') {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move the if (!moved) check above this code to prevent it from having to be executed if it's already clear we're not gonna move the element again.

@zackbloom
Copy link
Contributor

Nice job! I made a couple minor comments, but otherwise LGTM.

@pzuraq pzuraq force-pushed the only-move-when-not-static branch from 96180ea to ffb3118 Compare July 15, 2015 20:45
@pzuraq
Copy link
Author

pzuraq commented Jul 15, 2015

Thanks! Addressed those comments, everything should be in order now!

zackbloom added a commit that referenced this pull request Jul 15, 2015
Only move tethered element if its offset parent is not the body
@zackbloom zackbloom merged commit d0d600f into shipshapecode:master Jul 15, 2015
@zackbloom
Copy link
Contributor

Thanks @pzuraq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants