elementQuery icon indicating copy to clipboard operation
elementQuery copied to clipboard

Add amd support

Open itsravenous opened this issue 11 years ago • 2 comments

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 avatar Nov 20 '13 13:11 itsravenous

As requested in #8

itsravenous avatar Nov 20 '13 14:11 itsravenous

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

gergelyorosz avatar Sep 30 '14 09:09 gergelyorosz