Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Bug? Page.prototype.lazyload> calls optional lazyload function with Page as calling context instead of for each Listitem #32

Open
0xgeert opened this issue Apr 3, 2013 · 0 comments

Comments

@0xgeert
Copy link

0xgeert commented Apr 3, 2013

From the annotated source of Page.prototype.lazyload:

`Runs the given lazy-loading callback on all unloaded page content.

Takes:
callback: a function of the form function([$el]){}. Will run on each unloaded element, and will use the element as its calling context.`

I take it this means that each 'unloaded element', is a ListItem correct? This would make sense: each lazyloaded page iterates it's containing listitems and calls the optionally supplied Lazyload-function on each of them.

However this is not what's happening in Page.prototype.lazyload. Instead $el[x] is passed to the lazyloadfunction. Since $el is a jquery-wrapper around the page-domelement, $el only contains 1 element ($el[0]) the page dom element itself.

instead, iterating over $el.children() instead would do the trick, if I'm right about what Page.prototype.lazyload is supposed to do that is.

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

1 participant