mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
22 lines
No EOL
770 B
JavaScript
22 lines
No EOL
770 B
JavaScript
Meteor.startup(function () {
|
|
Template[getTemplate('postShare')].helpers({
|
|
sourceLink: function(){
|
|
return !!this.url ? this.url : getSiteUrl() + "posts/"+this._id;
|
|
},
|
|
viaTwitter: function () {
|
|
return !!getSetting('twitterAccount') ? 'via='+getSetting('twitterAccount') : '';
|
|
}
|
|
});
|
|
|
|
Template[getTemplate('postShare')].events({
|
|
'click .share-link': function(e){
|
|
var $this = $(e.target).parents('.post-share').find('.share-link');
|
|
var $share = $this.parents('.post-share').find('.share-options');
|
|
e.preventDefault();
|
|
$('.share-link').not($this).removeClass("active");
|
|
$(".share-options").not($share).addClass("hidden");
|
|
$this.toggleClass("active");
|
|
$share.toggleClass("hidden");
|
|
}
|
|
});
|
|
}); |