Skip to content

Commit

Permalink
Fixed filter result
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Nov 12, 2015
1 parent 01f0a6f commit 11f2487
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion loadmore.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
window.history.replaceState(jQuery.extend(true, window.history.state, {loadmore : historyState}), document.title);
}

$newData = $(data).filter(options.filterResult).insertBefore($this);
$newData = $(data).filter('*');
if (options.filterResult) {
$newData = $newData.find(options.filterResult).add($newData.filter(options.filterResult));
}
$newData.insertBefore($this);

if (options.rowsPerPage !== false && $(options.itemSelector || '*', $newData).length < (options.useOffset ? 1 : options.rowsPerPage) * (pageTarget - currentPage)) {
$this.trigger('loadmore:last').remove();
Expand Down

0 comments on commit 11f2487

Please sign in to comment.