I noticed an issue where ListView.prototype.append would take longer and longer if you were working with really long pages.
After digging into it:
There's seems to be an issue with how jquery computes .outerHeight(true) and .height(). The longer the page, the longer these take to compute. I'm using the useElementScroll value on something so I don't have an infinite page (rather a display: auto container with a fixed height).
This pull request makes it possible to do this now:
Assuming we have a list of DOM elements:
for (var i = 0, len = $els.length, item; i < len; i++) {
item = $($els[i]);
if (i === 0) {
item = infinity.convertToItem(this.listView, item);
cache = item;
} else {
item = new infinity.ListItem(item);
// pre-cache the height/width
// so we don't spend anytime trying to compute them
item.height = cache.height;
item.width = cache.width;
infinity.cacheCoordsFor(this.listView, item);
}
this.listView.append(item);
}
In addition, I also added a few small enhancements to not compute the parent.height() every time hasVacancy is called.
It doesn't appear the build files were generated after merging the 2 previous pull requests.
I left some comments in there. I can take these out if you prefer.
I noticed an issue where ListView.prototype.append would take longer and longer if you were working with really long pages.
After digging into it:
This pull request makes it possible to do this now:
Assuming we have a list of DOM elements:
In addition, I also added a few small enhancements to not compute the parent.height() every time hasVacancy is called.
It doesn't appear the build files were generated after merging the 2 previous pull requests.
I left some comments in there. I can take these out if you prefer.