This commit is contained in:
Sacha Greif 2013-10-29 16:05:55 +09:00
parent 90b2c8c6e4
commit 11a9637dff
4 changed files with 3 additions and 6 deletions

View file

@ -1,7 +1,7 @@
// ** Handlebars helpers **
Handlebars.registerHelper('eachWithRank', function(items, options) {
console.log('======= eachWithRank ========')
// not used, forces multiple renders
// note: cannot use this because it would delete and recreate all nodes
items.rewind()
var out = '';

View file

@ -248,7 +248,6 @@ PostsListController = RouteController.extend({
]
},
data: function () {
console.log('// postsList data function')
var view = this.path == '/' ? 'top' : this.path.split('/')[1];
var limit = this.params.limit || getSetting('postsPerPage', 10);
var parameters = getParameters(view, limit, this.params.slug);
@ -256,7 +255,7 @@ PostsListController = RouteController.extend({
Session.set('postsLimit', limit);
// get posts and decorate them with rank property
// note: using handlebars helper instead
// note: not actually used; find better way
// posts = posts.map(function (post, index) {
// post.rank = index;
// return post;

View file

@ -74,9 +74,6 @@ Template.post_item.helpers({
},
pointsUnitDisplayText: function(){
return this.votes == 1 ? 'point' : 'points';
},
lastRender: function(){
return Session.get('postItemLastRender');
}
});

View file

@ -1,5 +1,6 @@
Template.posts_list.helpers({
posts : function () {
// not used, forces multiple re-renders
// this.postsList.rewind();
// var posts = this.postsList.map(function (post, index, cursor) {
// post.rank = index;