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

Optimized calls to getComputedStyle #3

Merged
merged 1 commit into from
Sep 10, 2017

Conversation

pnicolli
Copy link
Contributor

@pnicolli pnicolli commented Sep 9, 2017

From the MDN docs on Window.getComputedStyle:

The returned style is a live CSSStyleDeclaration object, which updates itself automatically when the element's style is changed.

This PR changes the source code so that it calls getComputedStyle just once and then retrieves the width whenever needed.

@nzambello
Copy link
Owner

Nice shot! Gg wp

@nzambello nzambello merged commit 21ec527 into nzambello:master Sep 10, 2017
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