Vulcan/packages/telescope-embedly/lib/client/post_thumbnail.js
2015-04-13 14:52:03 +09:00

19 lines
No EOL
543 B
JavaScript

Template.postThumbnail.helpers({
postLink: function () {
return !!this.url ? getOutgoingUrl(this.url) : "/posts/"+this._id;
},
playVideoClass: function () {
return !!this.media ? 'post-thumbnail-has-video': '';
},
videoTemplate: function () {
return getTemplate('postVideo');
}
});
Template.postThumbnail.events({
'click .post-thumbnail-has-video': function (e) {
e.preventDefault();
$('body').addClass('showing-lightbox');
$(e.target).parents('.post').find('.post-video-lightbox').fadeIn('fast');
}
})