Skip to content

Conversation

@yogaraptor
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.

@yogaraptor
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