Merge branch 'ticket/r11769-facebook-hide' into develop

This commit is contained in:
Romu 2017-02-10 07:20:31 -08:00
commit 6691e258d4
3 changed files with 37 additions and 0 deletions

View File

@ -1,5 +1,6 @@
$( document ).ready(function() {
$('.vote_box').on('click', '.vote', function(e){
var boxes = $(this).parent('.vote_box');
var id_post = $(this).data('id');
var uri = baseUri+'modules/cmsps/ajax_voting.php';
@ -15,16 +16,22 @@ $( document ).ready(function() {
if (json.already_vote) {
if($(boxes).children('.already_vote').length == 0) {
$(boxes).append('<span class="already_vote">Déjà voté</span>');
$('#shareCtn').slideDown(function() {
$('html, body').animate({scrollTop: $('#shareCtn').offset().top}, 'slow');
});
}
} else {
if($(boxes).children('.already_vote').length == 0) {
$(boxes).append('<span class="already_vote">Merci</span>');
$('#shareCtn').addClass('open');
}
$('.nb_vote_'+id_post).each(function(index) {
$(this).html(json.nb_vote);
});
}
}
},
error : function(resultat, statut, erreur) {

View File

@ -2118,6 +2118,9 @@ main#categorycms { margin-bottom: 30px }
padding: 15px;
margin-bottom: 0;
}
#postcms #shareCtn {
display: none;
}
#postcms .share .title {
color: #333;
text-align: center;
@ -2530,9 +2533,11 @@ main#categorycms { margin-bottom: 30px }
#postcms .intro_post .intro_note .vote_box.button span { padding: 0 18px; font-size: 18px; }
#postcms .intro_post .intro_note .vote_box.button span i { display: none; }
#postcms .share .share_btn a {width: 190px; margin: 0 auto;}
#shareCtn .share .share_btn a { width: 100px; }
}
@media (max-width: 991px) {
#postcms #shareCtn { margin-bottom: 15px; }
.vote_box.button span i { display: inline;}
#postcms .intro_note .left { margin-left: 225px; margin-top: 25px; }

View File

@ -39,7 +39,32 @@
</div>
</div>
</div>
<div class="shareCtn">
<div id="shareCtn" class="animated-full ">
<div class="share">
<p class="title">{l s='Partager cette astuce'}</p>
<div class="row">
<div class="col-sm-4 share_btn facebook">
<a href="https://www.facebook.com/sharer/sharer.php?u={$link->getPostCmsLink($post->id)|escape:'html':'UTF-8'}" target="_blank">
<i class="awesome"></i> {l s='Facebook'}
</a>
</div>
<div class="col-sm-4 share_btn twitter">
<a href="http://twitter.com/intent/tweet/?hashtags=toutpratique&amp;url={$link->getPostCmsLink($post->id)|escape:'html':'UTF-8'}&amp;text={$post->title}" target="_blank">
<i class="awesome"></i> {l s='Twitter'}
</a>
</div>
<div class="col-sm-4 share_btn email">
<a href="mailto:?subject=Tout Pratique | {$post->title}&amp;body={$link->getPostCmsLink($post->id)|escape:'html':'UTF-8'}">
<i class="awesome"></i> {l s='Par email'}
</a>
</div>
</div>
</div>
</div>
</div>
{/if}
</div>
{if $post->products}