2015-05-18 10:12:48 +09:00
|
|
|
Template.post_thumbnail.helpers({
|
2015-04-22 07:50:11 +09:00
|
|
|
postLink: function () {
|
2015-06-18 13:04:38 +09:00
|
|
|
return Posts.getLink(this);
|
|
|
|
},
|
|
|
|
target: function () {
|
|
|
|
return !!this.url? "_blank" : "";
|
2015-04-22 07:50:11 +09:00
|
|
|
},
|
|
|
|
playVideoClass: function () {
|
|
|
|
return !!this.media ? 'post-thumbnail-has-video': '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-05-18 10:12:48 +09:00
|
|
|
Template.post_thumbnail.events({
|
2015-04-22 07:50:11 +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');
|
|
|
|
}
|
|
|
|
});
|