Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not letting define a different anchor than 'head' ? #91

Closed
alonl opened this issue Nov 10, 2014 · 8 comments
Closed

Why not letting define a different anchor than 'head' ? #91

alonl opened this issue Nov 10, 2014 · 8 comments

Comments

@alonl
Copy link

alonl commented Nov 10, 2014

I suggest to add a parameter for configuring the anchor which the files are injected to/before/after.

What if, for example, I need the lazy loaded files to be injected before or after some other files?

What do you think? I can post a pull request.

@ocombe
Copy link
Owner

ocombe commented Nov 11, 2014

hi,
Do you mean by anchor where the files are injected into the dom ? With a css selector ?
Why would you need this ?
You can always define your own jsloader and cssloader if you need something really specific.

@alonl
Copy link
Author

alonl commented Nov 11, 2014

Hey Olivier, thanks for your reply!
I'm not talking about the order, but about the place.
In my case, for example, I want a particular css file to be always after the 'lazyLoad'ed files. This file is always used, so it doesn't make sense to lazyLoad it, just because I want it to be after the lazyLoaded files.
My suggestion is to add an option for the files to be injected after/before some specific anchor, rather than the head. For example, one can define a in the head, and then tell the lazyLoad plugin to inject before that element.

@ocombe
Copy link
Owner

ocombe commented Nov 11, 2014

Yes, I edited my message once I undestood your question :)
It makes more sense now that you talk about css (since order is important).
You could define your own cssLoader to do that, I'm not sure it is an option that would really be of use for a lot of people.
But yes, you could imagine a new parameter for that. If it doesn't add too much code and is easy to use you can do a PR.

@alonl
Copy link
Author

alonl commented Nov 11, 2014

I just sent a PR. If it gets accepted, I'd be happy if you could release a new version.. Thanks :)

@alonl
Copy link
Author

alonl commented Nov 11, 2014

Awesome! When will you release an updated version?

@ocombe
Copy link
Owner

ocombe commented Nov 11, 2014

I'm working on unit tests that i'd like to integrate with the new release.
If I haven't finish those tonight, I'll make a new version for you.

@alonl
Copy link
Author

alonl commented Nov 11, 2014

Thanks a lot! 👍

@ocombe
Copy link
Owner

ocombe commented Nov 11, 2014

@ocombe ocombe closed this as completed Nov 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants