2014-08-28 10:16:17 +09:00
|
|
|
Template[getTemplate('postsLoadMore')].helpers({
|
|
|
|
hasMorePosts: function(){
|
|
|
|
// as long as we ask for N posts and all N posts showed up, then keep showing the "load more" button
|
2014-10-16 00:32:08 +02:00
|
|
|
return parseInt(Session.get('postsLimit')) == this.postCount
|
2014-08-28 10:16:17 +09:00
|
|
|
},
|
|
|
|
loadMoreUrl: function () {
|
|
|
|
var count = parseInt(Session.get('postsLimit')) + parseInt(getSetting('postsPerPage', 10));
|
|
|
|
var categorySegment = Session.get('categorySlug') ? Session.get('categorySlug') + '/' : '';
|
|
|
|
return '/' + Session.get('view') + '/' + categorySegment + count;
|
|
|
|
}
|
|
|
|
});
|