Commit bec3e0ec242a18eb9c1a1b53f2ce594be235bed1
1 parent
0708fbb4
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
fix for comments not scrolling
Showing
2 changed files
with
15 additions
and
2 deletions
Show diff stats
plugins/comment_paragraph/public/comment_paragraph_macro.js
| 1 | 1 | var comment_paragraph_anchor; |
| 2 | 2 | var lastSelectedArea = []; |
| 3 | 3 | var original_paragraphs = []; |
| 4 | +var originalArticleHeight = 0 | |
| 4 | 5 | |
| 5 | 6 | function setPlusIfZeroComments($){ |
| 6 | 7 | $('.comment-count').each(function(){ |
| ... | ... | @@ -15,6 +16,8 @@ jQuery(document).ready(function($) { |
| 15 | 16 | if($('.comment_paragraph').size() < 1) |
| 16 | 17 | return; |
| 17 | 18 | |
| 19 | + originalArticleHeight = $('.article-body').height(); | |
| 20 | + | |
| 18 | 21 | all_paragraphs = $('.comment_paragraph'); |
| 19 | 22 | all_paragraphs.each( function(paragraph) { |
| 20 | 23 | var paragraph_id = $( all_paragraphs.get(paragraph) ).attr('data-paragraph'); |
| ... | ... | @@ -66,6 +69,14 @@ jQuery(document).ready(function($) { |
| 66 | 69 | <div align="center" class="triangle-right" >Comentar</div>\ |
| 67 | 70 | </a>'); |
| 68 | 71 | |
| 72 | + function resizeArticle(paragraphId){ | |
| 73 | + var commentHeigh = $('#side_comment_' + paragraphId).height(); | |
| 74 | + if(commentHeigh > 0){ | |
| 75 | + $('.article-body').height(originalArticleHeight + commentHeigh + 50); | |
| 76 | + }else{ | |
| 77 | + $('.article-body').height(originalArticleHeight); | |
| 78 | + } | |
| 79 | + } | |
| 69 | 80 | |
| 70 | 81 | $('.side-comments-counter').click(function(){ |
| 71 | 82 | var paragraphId = $(this).data('paragraph'); |
| ... | ... | @@ -74,11 +85,9 @@ jQuery(document).ready(function($) { |
| 74 | 85 | if($('.comment-paragraph-slide-left').size()==0){ |
| 75 | 86 | $('.article-body').addClass('comment-paragraph-slide-left'); |
| 76 | 87 | $('#side_comment_' + paragraphId).show(); |
| 77 | - $('#side_comment_' + paragraphId).find().show(); | |
| 78 | 88 | }else{ |
| 79 | 89 | $('.article-body').removeClass('comment-paragraph-slide-left'); |
| 80 | 90 | $('.side-comment').hide(); |
| 81 | - $('.side-comment').find().hide(); | |
| 82 | 91 | } |
| 83 | 92 | $('#comment-bubble').hide(); |
| 84 | 93 | //Loads the comments |
| ... | ... | @@ -89,6 +98,7 @@ jQuery(document).ready(function($) { |
| 89 | 98 | }).done(function() { |
| 90 | 99 | var button = $('#page-comment-form-' + paragraphId + ' a').get(0); |
| 91 | 100 | button.click(); |
| 101 | + resizeArticle(paragraphId); | |
| 92 | 102 | }); |
| 93 | 103 | }); |
| 94 | 104 | |
| ... | ... | @@ -109,6 +119,7 @@ jQuery(document).ready(function($) { |
| 109 | 119 | }).done(function() { |
| 110 | 120 | var button = $('#page-comment-form-' + paragraphId + ' a').get(0); |
| 111 | 121 | button.click(); |
| 122 | + resizeArticle(paragraphId); | |
| 112 | 123 | }); |
| 113 | 124 | }); |
| 114 | 125 | ... | ... |
plugins/comment_paragraph/public/style.css