Vulcan/packages/telescope-embedly/lib/client/post_thumbnail.js

19 lines
543 B
JavaScript
Raw Normal View History

Template.postThumbnail.helpers({
2014-08-29 10:37:35 +09:00
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({
2014-08-29 10:37:35 +09:00
'click .post-thumbnail-has-video': function (e) {
e.preventDefault();
$('body').addClass('showing-lightbox');
$(e.target).parents('.post').find('.post-video-lightbox').fadeIn('fast');
}
})