Commit 088819da3e216c78a78ef04ee471ac57f0a4e031

Authored by Guilherme Rojas V. de Lima
Committed by Guilherme Rojas
1 parent f92dd1dc

Refactored the accordion behavior

Now accordion may open more then one tab without close others.
Signed-off By: Fellipe Souto Sampaio <fllsouto@gmail.com>
app/views/repositories/show.html.erb
@@ -47,14 +47,20 @@ @@ -47,14 +47,20 @@
47 <hr/> 47 <hr/>
48 48
49 <div id="repository-accordion"> 49 <div id="repository-accordion">
50 - <h3>Processing information</h3>  
51 - <div id="processing_information"><%= image_tag 'loader.gif' %> Loading data. Please, wait.</div>  
52 -  
53 - <h3>Modules Tree</h3>  
54 - <div id="module_tree"><%= image_tag 'loader.gif' %> Loading data. Please, wait.</div>  
55 -  
56 - <h3>Metric Results</h3>  
57 - <div id="metric_results"><%= image_tag 'loader.gif' %> Loading data. Please, wait.</div> 50 + <div id="processing-accordion">
  51 + <h3>Processing information</h3>
  52 + <div id="processing_information"><%= image_tag 'loader.gif' %> Loading data. Please, wait.</div>
  53 + </div>
  54 +
  55 + <div id="module-accordion">
  56 + <h3>Modules Tree</h3>
  57 + <div id="module_tree"><%= image_tag 'loader.gif' %> Loading data. Please, wait.</div>
  58 + </div>
  59 +
  60 + <div id="metric-accordion">
  61 + <h3>Metric Results</h3>
  62 + <div id="metric_results"><%= image_tag 'loader.gif' %> Loading data. Please, wait.</div>
  63 + </div>
58 </div> 64 </div>
59 <script type="text/javascript"> 65 <script type="text/javascript">
60 $(document).ready(function () { 66 $(document).ready(function () {
@@ -63,9 +69,12 @@ @@ -63,9 +69,12 @@
63 69
64 //Loads the accordion 70 //Loads the accordion
65 $(function() { 71 $(function() {
66 - $( "#repository-accordion" ).accordion({  
67 - heightStyle: "content" 72 + $( "#repository-accordion > div" ).accordion({
  73 + heightStyle: "content",
  74 + collapsible: true,
68 }); 75 });
  76 + $("#module-accordion").accordion({active: false})
  77 + $("#metric-accordion").accordion({active: false})
69 }); 78 });
70 </script> 79 </script>
71 80
features/repository/show/repository_info.feature
@@ -36,16 +36,15 @@ Feature: Show Repository @@ -36,16 +36,15 @@ Feature: Show Repository
36 And I should see "COLLECTING time" 36 And I should see "COLLECTING time"
37 And I should see "ANALYZING time" 37 And I should see "ANALYZING time"
38 When I click the "Metric Results" h3 38 When I click the "Metric Results" h3
  39 + And I click the "Modules Tree" h3
39 Then I should see "Metric" 40 Then I should see "Metric"
40 And I should see "Value" 41 And I should see "Value"
41 And I should see "Weight" 42 And I should see "Weight"
42 And I should see "Threshold" 43 And I should see "Threshold"
43 - When I click the "Modules Tree" h3  
44 - Then I should see "Name" 44 + And I should see "Name"
45 And I should see "Granularity" 45 And I should see "Granularity"
46 And I should see "Grade" 46 And I should see "Grade"
47 - When I click the "Processing information" h3  
48 - And I click the Reprocess link 47 + When I click the Reprocess link
49 Then I should see "LOADING" 48 Then I should see "LOADING"
50 49
51 @kalibro_restart @javascript 50 @kalibro_restart @javascript