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

Add amd support #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

itsravenous
Copy link

This pull req adds support for requireJS-style AMD loading of the script, while still allowing it to be loaded normally via a script tag.

It splits the getEmPixels function into its own file and defines it as a separate module, upon which the defined elementQuery module depends.

The modules are explicitly named rather than anonymous: elementQuery and getEmPixels.

The result has not been feature-tested (lunchhour project!), but I have tested that the same objects are attached to global or exported via the module API as would have been before. This might be good enough for you, or not. Either way, hope it's useful.

@itsravenous
Copy link
Author

As requested in #8

@gergelyorosz
Copy link

Are there any plans to merge this in? Having AMD support would make this component much more reusable.

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