mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
working but with errors…
This commit is contained in:
parent
9eb6e7afab
commit
745fa28370
2 changed files with 5 additions and 7 deletions
|
@ -248,7 +248,6 @@ Router.map(function() {
|
||||||
waitOn: postsSubscriptions.top = postListSubscription(selectTop, sortPosts('score'), 10),
|
waitOn: postsSubscriptions.top = postListSubscription(selectTop, sortPosts('score'), 10),
|
||||||
after: function() {
|
after: function() {
|
||||||
Session.set('view', 'top');
|
Session.set('view', 'top');
|
||||||
currentSubscription = postsSubscriptions.top;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -258,7 +257,6 @@ Router.map(function() {
|
||||||
waitOn: postsSubscriptions.top = postListSubscription(selectTop, sortPosts('score'), 11),
|
waitOn: postsSubscriptions.top = postListSubscription(selectTop, sortPosts('score'), 11),
|
||||||
after: function() {
|
after: function() {
|
||||||
Session.set('view', 'top');
|
Session.set('view', 'top');
|
||||||
currentSubscription = postsSubscriptions.top;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -270,7 +268,6 @@ Router.map(function() {
|
||||||
waitOn: postsSubscriptions.new = postListSubscription(selectNew, sortPosts('submitted'), 12),
|
waitOn: postsSubscriptions.new = postListSubscription(selectNew, sortPosts('submitted'), 12),
|
||||||
after: function() {
|
after: function() {
|
||||||
Session.set('view', 'new');
|
Session.set('view', 'new');
|
||||||
currentSubscription = postsSubscriptions.new;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
Template.posts_list.helpers({
|
Template.posts_list.helpers({
|
||||||
posts: function() {
|
posts: function() {
|
||||||
return currentSubscription.fetch();
|
console.log(postsSubscriptions[Session.get('view')])
|
||||||
|
return postsSubscriptions[Session.get('view')].fetch();
|
||||||
},
|
},
|
||||||
postsReady: function() {
|
postsReady: function() {
|
||||||
return currentSubscription.ready();
|
return postsSubscriptions[Session.get('view')].ready();
|
||||||
},
|
},
|
||||||
allPostsLoaded: function(){
|
allPostsLoaded: function(){
|
||||||
allPostsLoaded = currentSubscription.fetch().length < currentSubscription.loaded();
|
allPostsLoaded = postsSubscriptions[Session.get('view')].fetch().length < postsSubscriptions[Session.get('view')].loaded();
|
||||||
Session.set('allPostsLoaded', allPostsLoaded);
|
Session.set('allPostsLoaded', allPostsLoaded);
|
||||||
return allPostsLoaded;
|
return allPostsLoaded;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +26,7 @@ Template.posts_list.events({
|
||||||
'click .more-link': function(e) {
|
'click .more-link': function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
Session.set('currentScroll',$('body').scrollTop());
|
Session.set('currentScroll',$('body').scrollTop());
|
||||||
currentSubscription.loadNextPage();
|
postsSubscriptions[Session.get('view')].loadNextPage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue