Commit 3ae088dedcd84a3e7665152d85d8a6358ef9a7c9
1 parent
7532dfd0
Exists in
master
and in
11 other branches
proposals_discussion: added twitter share button
Showing
4 changed files
with
22 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,14 @@ |
1 | +function initTwitterButton() { | |
2 | + !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); | |
3 | +} | |
4 | + | |
5 | +jQuery(document).ready(function($) { | |
6 | + initTwitterButton(); | |
7 | + $('.proposals').on('mouseenter', '.proposal', function() { | |
8 | + twttr.widgets.load(); | |
9 | + $('.proposal .social').hide(); | |
10 | + $(this).find('.social').show("fast"); | |
11 | + }).on('mouseleave', '.proposal', function() { | |
12 | + $(this).find('.social').hide("fast"); | |
13 | + }); | |
14 | +}); | ... | ... |
views/content_viewer/_proposal_card.html.erb
... | ... | @@ -4,6 +4,9 @@ |
4 | 4 | <div class="title"> |
5 | 5 | <%= link_to proposal_card.name, proposal_card.view_url %> |
6 | 6 | </div> |
7 | + <div class="social"> | |
8 | + <%= render :partial => 'content_viewer/social', :locals => {:proposal => proposal_card} %> | |
9 | + </div> | |
7 | 10 | <div class="abstract"> |
8 | 11 | <%= link_to strip_tags(proposal_card.abstract), proposal_card.view_url %> |
9 | 12 | </div> | ... | ... |
views/content_viewer/_proposals_list.html.erb