Commit a843f4819806010fde7d91652990c41d08050edb

Authored by Evandro Jr
1 parent 4330b59e

fixed loading flower at firefox

plugins/comment_paragraph/public/comment_paragraph_macro.js
@@ -37,8 +37,8 @@ jQuery(document).ready(function($) { @@ -37,8 +37,8 @@ jQuery(document).ready(function($) {
37 cssApplier = rangy.createCssClassApplier("commented-area", {normalize: false}); 37 cssApplier = rangy.createCssClassApplier("commented-area", {normalize: false});
38 //Add marked text bubble 38 //Add marked text bubble
39 $("body").append('\ 39 $("body").append('\
40 - <a id="comment-bubble" style="width:120px;text-decoration: none">\  
41 - <div align="center" class="triangle-right" >Comentar<br>+</div>\ 40 + <a id="comment-bubble" style="width:90px;text-decoration: none">\
  41 + <div align="center" class="triangle-right" >Comentar</div>\
42 </a>'); 42 </a>');
43 43
44 $('.side-comments-counter').click(function(){ 44 $('.side-comments-counter').click(function(){
@@ -54,9 +54,9 @@ jQuery(document).ready(function($) { @@ -54,9 +54,9 @@ jQuery(document).ready(function($) {
54 dataType: "script", 54 dataType: "script",
55 url: url 55 url: url
56 }).done(function() { 56 }).done(function() {
57 - $('#fancybox-loading').hide();  
58 var button = $('#page-comment-form-' + paragraphId + ' a').get(0); 57 var button = $('#page-comment-form-' + paragraphId + ' a').get(0);
59 button.click(); 58 button.click();
  59 + $('#fancybox-loading').hide();
60 alignSideComments(paragraphId); 60 alignSideComments(paragraphId);
61 }); 61 });
62 }); 62 });
@@ -73,9 +73,9 @@ jQuery(document).ready(function($) { @@ -73,9 +73,9 @@ jQuery(document).ready(function($) {
73 dataType: "script", 73 dataType: "script",
74 url: url 74 url: url
75 }).done(function() { 75 }).done(function() {
76 - $('#fancybox-loading').hide();  
77 var button = $('#page-comment-form-' + paragraphId + ' a').get(0); 76 var button = $('#page-comment-form-' + paragraphId + ' a').get(0);
78 button.click(); 77 button.click();
  78 + $('#fancybox-loading').hide();
79 alignSideComments(paragraphId); 79 alignSideComments(paragraphId);
80 }); 80 });
81 }); 81 });
@@ -88,14 +88,14 @@ jQuery(document).ready(function($) { @@ -88,14 +88,14 @@ jQuery(document).ready(function($) {
88 $('.comments_list_toggle_paragraph_' + paragraphId).width('250px'); 88 $('.comments_list_toggle_paragraph_' + paragraphId).width('250px');
89 $('.required-field').removeClass("required-field"); 89 $('.required-field').removeClass("required-field");
90 } 90 }
91 - 91 +
92 function hideAllCommentsExcept(clickedParagraph){ 92 function hideAllCommentsExcept(clickedParagraph){
93 $(".side-comment").each(function(){ 93 $(".side-comment").each(function(){
94 paragraph = $(this).data('paragraph'); 94 paragraph = $(this).data('paragraph');
95 if(paragraph != clickedParagraph){ 95 if(paragraph != clickedParagraph){
96 $(this).hide(); 96 $(this).hide();
97 $(this).find().hide(); 97 $(this).find().hide();
98 - } 98 + }
99 }); 99 });
100 } 100 }
101 101
@@ -128,7 +128,7 @@ jQuery(document).ready(function($) { @@ -128,7 +128,7 @@ jQuery(document).ready(function($) {
128 var currentMousePos = { x: -1, y: -1 }; 128 var currentMousePos = { x: -1, y: -1 };
129 currentMousePos.x = event.pageX; 129 currentMousePos.x = event.pageX;
130 currentMousePos.y = event.pageY; 130 currentMousePos.y = event.pageY;
131 - $("#comment-bubble").css({top: event.pageY-100, left: event.pageX-70, position:'absolute'}); 131 + $("#comment-bubble").css({top: event.pageY-70, left: event.pageX-70, position:'absolute'});
132 //Relates a bubble to the mouse up paragraph 132 //Relates a bubble to the mouse up paragraph
133 $("#comment-bubble").data("paragraphId", paragraphId) 133 $("#comment-bubble").data("paragraphId", paragraphId)
134 //Prepare to open the div 134 //Prepare to open the div
@@ -136,7 +136,7 @@ jQuery(document).ready(function($) { @@ -136,7 +136,7 @@ jQuery(document).ready(function($) {
136 $("#comment-bubble").data("url", url) 136 $("#comment-bubble").data("url", url)
137 $("#comment-bubble").show(); 137 $("#comment-bubble").show();
138 var rootElement = $(this).get(0); 138 var rootElement = $(this).get(0);
139 - //Stores the lastParagraph of paragraph for some reason 139 + //Stores the HTML content of the lastParagraph
140 lastParagraph[paragraphId] = rootElement.innerHTML; 140 lastParagraph[paragraphId] = rootElement.innerHTML;
141 //Maybe it is needed to handle exceptions here 141 //Maybe it is needed to handle exceptions here
142 try{ 142 try{
@@ -147,7 +147,7 @@ jQuery(document).ready(function($) { @@ -147,7 +147,7 @@ jQuery(document).ready(function($) {
147 //Translate this mesage 147 //Translate this mesage
148 deselectAll(); 148 deselectAll();
149 rangy.init(); 149 rangy.init();
150 - cssApplier = rangy.createCssClassApplier("commented-area", {normalize: false}); 150 + cssApplier = rangy.createCssClassApplier("commented-area", {normalize: false});
151 return; 151 return;
152 } 152 }
153 //Register the area the has been selected at input.selected_area 153 //Register the area the has been selected at input.selected_area
@@ -169,7 +169,7 @@ jQuery(document).ready(function($) { @@ -169,7 +169,7 @@ jQuery(document).ready(function($) {
169 function deselectAll(){ 169 function deselectAll(){
170 $(".commented-area").contents().unwrap(); 170 $(".commented-area").contents().unwrap();
171 } 171 }
172 - 172 +
173 function processAnchor(){ 173 function processAnchor(){
174 var anchor = window.location.hash; 174 var anchor = window.location.hash;
175 if(anchor.length==0) return; 175 if(anchor.length==0) return;
@@ -211,7 +211,7 @@ jQuery(document).ready(function($) { @@ -211,7 +211,7 @@ jQuery(document).ready(function($) {
211 211
212 $(document).on('mouseout', 'li.article-comment', function(){ 212 $(document).on('mouseout', 'li.article-comment', function(){
213 deselectAll(); 213 deselectAll();
214 - var paragraph_id = $(this).find('input.paragraph_id').val(); 214 + var paragraph_id = $(this).find('input.paragraph_id').val();
215 var rootElement = $('#comment_paragraph_'+ paragraph_id).get(0); 215 var rootElement = $('#comment_paragraph_'+ paragraph_id).get(0);
216 216
217 if(lastSelectedArea[paragraph_id] != null && lastSelectedArea[paragraph_id] != 'undefined' ){ 217 if(lastSelectedArea[paragraph_id] != null && lastSelectedArea[paragraph_id] != 'undefined' ){