Commit bec3e0ec242a18eb9c1a1b53f2ce594be235bed1

Authored by Evandro Jr
1 parent 0708fbb4

fix for comments not scrolling

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
... ... @@ -242,6 +242,8 @@ div[class^=&#39;comment-paragraph-loading-&#39;] {
242 242  
243 243 .comment-paragraph-group-comments{
244 244 position: absolute;
  245 + background-color: white;
  246 + z-index: 9999;
245 247 }
246 248  
247 249 .comment-paragraph-slide-left{
... ...