Commit 07e194811f50c7db85ff092058e633d5e6fd2566

Authored by Caio Salgado + Diego Araújo + Pedro Leal
Committed by Paulo Meireles
1 parent 39b5e40b

[mezuro] comments are fully working

plugins/mezuro/public/javascripts/project_content.js
1 var processingTree = false; 1 var processingTree = false;
2 jQuery(function (){ 2 jQuery(function (){
3 jQuery('.source-tree-link').live("click", reloadModule); 3 jQuery('.source-tree-link').live("click", reloadModule);
4 - showLoadingProcess(true); 4 + jQuery('[data-show]').live("click", toggle_mezuro);
  5 + showLoadingProcess(true);
5 showProjectContent(); 6 showProjectContent();
6 }); 7 });
7 8
@@ -9,7 +10,8 @@ function showProjectContent() { @@ -9,7 +10,8 @@ function showProjectContent() {
9 callAction('project_state', {}, showProjectContentFor); 10 callAction('project_state', {}, showProjectContentFor);
10 } 11 }
11 12
12 -function toogle(element){ 13 +function toggle_mezuro(){
  14 + var element = jQuery(this).attr('data-show');
13 jQuery(element).toggle(); 15 jQuery(element).toggle();
14 return false; 16 return false;
15 } 17 }
plugins/mezuro/views/content_viewer/_module_result.rhtml
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <% module_result.metric_results.each do |metric_result| %> 18 <% module_result.metric_results.each do |metric_result| %>
19 <% range = metric_result.range %> 19 <% range = metric_result.range %>
20 <tr> 20 <tr>
21 - <td><a href="#" onClick="toogle('.<%= metric_result.metric.name.delete("() ") %>')";><%= metric_result.metric.name %></a></td> 21 + <td><a href="#" data-show=".<%= metric_result.metric.name.delete("() ")%>"><%= metric_result.metric.name %></a></td>
22 <td><%= metric_result.value.slice(/[0-9]+\.[0-9]{1,2}/) %></td> <!--FIXME: Move to helper eventually--> 22 <td><%= metric_result.value.slice(/[0-9]+\.[0-9]{1,2}/) %></td> <!--FIXME: Move to helper eventually-->
23 <td><%= metric_result.weight %></td> 23 <td><%= metric_result.weight %></td>
24 <% if range.nil? %> 24 <% if range.nil? %>
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td> 27 <td style="background-color: #<%= range.color[2..-1] %>"><%= range.label %></td>
28 <% end %> 28 <% end %>
29 </tr> 29 </tr>
30 - <tr class="<%= metric_result.metric.name.delete("() ")%>"> 30 + <tr class="<%= metric_result.metric.name.delete("() ")%>" style="display: none;">
31 <td colspan="4" align="right"> 31 <td colspan="4" align="right">
32 <%= range.comments.nil? ? 'comment empty' : range.comments %> 32 <%= range.comments.nil? ? 'comment empty' : range.comments %>
33 </td> 33 </td>