Vulcan/client/views/posts/posts_new.js

20 lines
441 B
JavaScript
Raw Normal View History

2012-09-18 11:49:17 +09:00
Template.posts_new.posts = function(){
return newPosts();
2012-09-18 11:49:17 +09:00
};
2012-10-09 16:11:30 +09:00
Template.posts_new.helpers({
moreLinkDistance: function(){
return newPosts().length * 80;
2012-10-10 11:25:00 +09:00
},
allPostsLoaded: function(){
return newPosts().length < Session.get('newPageLimit');
2012-10-09 16:11:30 +09:00
}
});
2012-10-08 16:12:47 +02:00
Template.posts_new.events({
2012-10-09 16:11:30 +09:00
'click .more-link': function(e) {
e.preventDefault();
Session.set('newPageLimit', Session.get('newPageLimit') + NEW_PAGE_PER_PAGE)
2012-10-09 12:02:37 +09:00
}
2012-10-08 16:12:47 +02:00
});