Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Usage of objectfit as global variable in module context #26

Open
feeela opened this issue Feb 27, 2015 · 5 comments
Open

Usage of objectfit as global variable in module context #26

feeela opened this issue Feb 27, 2015 · 5 comments
Labels

Comments

@feeela
Copy link

feeela commented Feb 27, 2015

In src/polyfill.getMatchedCSSRules.js you are using objectfit as a global variable, which is not set, if the polyfill is loaded via an AMD module loader.

Code that throws the exception "ReferenceError: objectFit is not defined": if (objectFit.disableCrossDomain == 'true')

Currently the polyfill is not usable when using an AMD loader…

@anselmh anselmh added the bug label Feb 27, 2015
@anselmh
Copy link
Owner

anselmh commented Feb 27, 2015

Thank for reporting. You’re right. If you have time, feel free to submit a Pull Request with a fix. Otherwise I’ll try to fix it as soon as possible.

@gpbl
Copy link

gpbl commented Mar 12, 2015

If you are using webpack (it works also for AMD modules) you can use the expose-loader to set the global variable:

require('expose?objectFit!object-fit/dist/polyfill.object-fit.js');

@mjsarfatti
Copy link

Any progress on this? I cannot seem to be able to load object-fit with requireJS.
I am willing to spend some time coding a fix for it, but my knowledge of AMD is way too basic. If you could point me into some direction it would be great.

@anselmh
Copy link
Owner

anselmh commented Apr 26, 2015

Ah, damn it. Had really no time in the past weeks. Actually I hope to fix this in the next week, ultimately the week after. Sorry about the hassle.

@man-oi
Copy link

man-oi commented May 8, 2015

yeah, this would be great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants