elementQuery
elementQuery copied to clipboard
Add amd support
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.
As requested in #8
Are there any plans to merge this in? Having AMD support would make this component much more reusable.