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

Fix for margin issue #286

Merged
merged 4 commits into from
Nov 4, 2015
Merged

Fix for margin issue #286

merged 4 commits into from
Nov 4, 2015

Conversation

danballance
Copy link
Contributor

Hi,

This is hopefully a fix for the margin issue here: #281

Two simple changes are made. getComputedBodyStyle takes an extra parameter to specify the element to check. If nothing is passed, it will fall back to the previous behaviour of using the body element. Additionally, when getMaxElement iterates over its list of elements, the element is passed to getComputedBodyStyle in order to fetch that elements margin.

@davidjbradshaw
Copy link
Owner

I guess getComputedBodyStyle() should be renamed to getComputedStyle().

Also I think that,

el = typeof el !== 'undefined' ? el : document.body;

can be written as just.

el =  el || document.body;

Otherwise looks good.

@danballance
Copy link
Contributor Author

Okay thanks for the feedback, I'll get those changes made now.

davidjbradshaw added a commit that referenced this pull request Nov 4, 2015
@davidjbradshaw davidjbradshaw merged commit 0325518 into davidjbradshaw:master Nov 4, 2015
@davidjbradshaw
Copy link
Owner

Thanks for you help on this. Released as v3.5.1.

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