Vulcan/packages/telescope-embedly/lib/client/post_thumbnail.js
2015-06-18 13:04:38 +09:00

19 lines
502 B
JavaScript

Template.post_thumbnail.helpers({
postLink: function () {
return Posts.getLink(this);
},
target: function () {
return !!this.url? "_blank" : "";
},
playVideoClass: function () {
return !!this.media ? 'post-thumbnail-has-video': '';
}
});
Template.post_thumbnail.events({
'click .post-thumbnail-has-video': function (e) {
e.preventDefault();
$('body').addClass('showing-lightbox');
$(e.target).parents('.post').find('.post-video-lightbox').fadeIn('fast');
}
});