diff --git a/modules/cmsps/voting.js b/modules/cmsps/voting.js index 108ce950..b4974686 100644 --- a/modules/cmsps/voting.js +++ b/modules/cmsps/voting.js @@ -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('Déjà voté'); + $('#shareCtn').slideDown(function() { + $('html, body').animate({scrollTop: $('#shareCtn').offset().top}, 'slow'); + }); + } } else { if($(boxes).children('.already_vote').length == 0) { $(boxes).append('Merci'); + $('#shareCtn').addClass('open'); } $('.nb_vote_'+id_post).each(function(index) { $(this).html(json.nb_vote); }); } + } }, error : function(resultat, statut, erreur) { diff --git a/themes/toutpratique/css/global.css b/themes/toutpratique/css/global.css index f781d3c1..9e5ed272 100644 --- a/themes/toutpratique/css/global.css +++ b/themes/toutpratique/css/global.css @@ -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; } diff --git a/themes/toutpratique/postcms.tpl b/themes/toutpratique/postcms.tpl index d5cf459f..a73429f5 100644 --- a/themes/toutpratique/postcms.tpl +++ b/themes/toutpratique/postcms.tpl @@ -39,7 +39,32 @@ +
{/if} + {if $post->products}