Commit c0610875f20a116155853171961635487fe95aea
Committed by
Paulo Meireles
1 parent
8217f536
Exists in
master
and in
29 other branches
show loading message for ajax results
Showing
3 changed files
with
16 additions
and
6 deletions
Show diff stats
plugins/mezuro/public/javascripts/results.js
... | ... | @@ -4,11 +4,19 @@ function results($) { |
4 | 4 | var project = $('#module-result').attr('data-project-id'); |
5 | 5 | var module_name = $(this).attr('data-module-name'); |
6 | 6 | var endpoint = '/profile/' + profile + '/plugins/mezuro/metrics/' + project; |
7 | - // FIXME turn on the 'loading ...' | |
8 | - $.get(endpoint, { module_name: module_name }, function(content) { | |
7 | + show_loading_message(); | |
8 | + $.get(endpoint, {module_name: module_name}, function(content) { | |
9 | 9 | $('#module-result').html(content); |
10 | - // FIXME turn off the 'loading ...' | |
10 | + show_result_table(); | |
11 | 11 | }); |
12 | 12 | return false; |
13 | 13 | }); |
14 | -}; | |
15 | 14 | \ No newline at end of file |
15 | +} | |
16 | +function show_loading_message() { | |
17 | + jQuery('#loading-message').attr("style", "display: inline"); | |
18 | + jQuery('#module-result').attr("style", "display: none"); | |
19 | +} | |
20 | +function show_result_table(){ | |
21 | + jQuery('#loading-message').attr("style", "display: none"); | |
22 | + jQuery('#module-result').attr("style", "display: inline"); | |
23 | +} | |
16 | 24 | \ No newline at end of file | ... | ... |
plugins/mezuro/views/content_viewer/_module_result.rhtml
plugins/mezuro/views/content_viewer/show_project.rhtml
... | ... | @@ -71,6 +71,9 @@ |
71 | 71 | <div id='module-result' data-project-id='<%= @page.id %>'> |
72 | 72 | <%= render :partial => 'module_result', :locals => { :module_result => @page.module_result(@project.name) } %> |
73 | 73 | </div> |
74 | + <div id="loading-message"> | |
75 | + loading results... | |
76 | + </div> | |
74 | 77 | <script> |
75 | 78 | jQuery(results); |
76 | 79 | </script> | ... | ... |