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

option to ignore imagesLoaded #53

Open
Redsandro opened this issue Aug 3, 2016 · 2 comments
Open

option to ignore imagesLoaded #53

Redsandro opened this issue Aug 3, 2016 · 2 comments

Comments

@Redsandro
Copy link

Redsandro commented Aug 3, 2016

imagesLoaded can quickly add a couple of seconds to aligning your lists. In some cases it is not necessary.

I'd like to see an option specified to the helper (that defaults to true for backwards compatibility reasons) to skip waiting for images to load. E.g.:

{{#masonry-grid
    items=model
    customLayout=true
    imagesLoaded=false
    onLayoutComplete=(action 'onLayoutComplete')
    as |item index grid|}}
@carrotcomputer
Copy link

carrotcomputer commented Aug 10, 2016

To confirm, imagesLoaded is not actually part of this addon at the moment and has to be used separately (as per advise here http://masonry.desandro.com/layout.html#imagesloaded)?

If it is, what is the current default behaviour?

@Redsandro
Copy link
Author

Redsandro commented Oct 2, 2016

@sparkrevolutions

To confirm, imagesLoaded is not actually part of this addon at the moment and has to be used separately

Well, it waits for all images to load before doing the grid spacing. How do you mean it's not actually part of this addon? See:

imagesLoaded(get(this, 'element'), () => {

    Ember.run.scheduleOnce('afterRender', this, () => {
      imagesLoaded(get(this, 'element'), () => {
        if (masonry) {
          masonry.reloadItems();
        } else {

The noticeable consequence in my case is that every item is drawn on top of each other and only once every image is loaded do the items pop into place. This looks very hacky to the user, so we need to hide the content until the masonry magic (and thus the loading of images) is finished.

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

No branches or pull requests

1 participant