From 99991542973f0fbad7fce34d34afa6dcff2e67de Mon Sep 17 00:00:00 2001 From: Ramon Wijnands Date: Sat, 11 Oct 2014 21:06:57 +0200 Subject: [PATCH] inline the 'fromNow' template call for better rendering performance --- client/views/playlists/playlist.html | 2 +- client/views/playlists/playlist.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/views/playlists/playlist.html b/client/views/playlists/playlist.html index 1cc8bd3..1ab5428 100644 --- a/client/views/playlists/playlist.html +++ b/client/views/playlists/playlist.html @@ -228,7 +228,7 @@

{{snippet.title}}

{{> userLink}} {{/each}}

-

Added by {{#with this.author}}{{> userLink}}{{/with}} {{fromNow this.added}}

+

Added by {{#with this.author}}{{> userLink}}{{/with}} {{this.addedFromNow}}

diff --git a/client/views/playlists/playlist.js b/client/views/playlists/playlist.js index ad03d24..70c4483 100644 --- a/client/views/playlists/playlist.js +++ b/client/views/playlists/playlist.js @@ -441,7 +441,7 @@ Template.songs.songs = function() { //extra info song.author = Meteor.users.findOne({_id: entry.author}); - song.added = entry.added; + song.addedFromNow = entry.added ? moment(entry.added).fromNow() : ""; return song; });