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

Initialize after window load #3

Closed
ghost opened this issue Jan 21, 2014 · 4 comments
Closed

Initialize after window load #3

ghost opened this issue Jan 21, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 21, 2014

With a simple check of document.readyState === 'complete', the plugin could work even after the page is loaded.

@anselmh
Copy link
Owner

anselmh commented Jan 22, 2014

Hi, thanks for raising this feature-request. Could you point out what benefit is has and if the performance will not be affected by this change? Thank you. :)

@ghost
Copy link
Author

ghost commented Jan 22, 2014

The benefit is that it would work if you load the plugin asynchronously (e.g. with Require.js). The performance should not be an issue, since if you omit this part, the plugin does not perform at all (when being loaded after window load). I hope this makes sense.

By the way, I checked the other object fit polyfills and this is by far the best (excerpt for this minor issue).

@Schepp
Copy link
Collaborator

Schepp commented Jan 23, 2014

Excellent suggestion. I just updated the library accordingly: https://github.com/anselmh/object-fit/releases

@ghost
Copy link
Author

ghost commented Jan 23, 2014

Awesome! Thanks a lot.

@anselmh anselmh closed this as completed Feb 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants