From c0610875f20a116155853171961635487fe95aea Mon Sep 17 00:00:00 2001 From: João M. M. da Silva + Carlos Morais Date: Mon, 30 Jan 2012 11:41:29 -0200 Subject: [PATCH] show loading message for ajax results --- plugins/mezuro/public/javascripts/results.js | 16 ++++++++++++---- plugins/mezuro/views/content_viewer/_module_result.rhtml | 3 +-- plugins/mezuro/views/content_viewer/show_project.rhtml | 3 +++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/plugins/mezuro/public/javascripts/results.js b/plugins/mezuro/public/javascripts/results.js index 48445f8..0948c70 100644 --- a/plugins/mezuro/public/javascripts/results.js +++ b/plugins/mezuro/public/javascripts/results.js @@ -4,11 +4,19 @@ function results($) { var project = $('#module-result').attr('data-project-id'); var module_name = $(this).attr('data-module-name'); var endpoint = '/profile/' + profile + '/plugins/mezuro/metrics/' + project; - // FIXME turn on the 'loading ...' - $.get(endpoint, { module_name: module_name }, function(content) { + show_loading_message(); + $.get(endpoint, {module_name: module_name}, function(content) { $('#module-result').html(content); - // FIXME turn off the 'loading ...' + show_result_table(); }); return false; }); -}; \ No newline at end of file +} +function show_loading_message() { + jQuery('#loading-message').attr("style", "display: inline"); + jQuery('#module-result').attr("style", "display: none"); +} +function show_result_table(){ + jQuery('#loading-message').attr("style", "display: none"); + jQuery('#module-result').attr("style", "display: inline"); +} \ No newline at end of file diff --git a/plugins/mezuro/views/content_viewer/_module_result.rhtml b/plugins/mezuro/views/content_viewer/_module_result.rhtml index 4c09f54..da8ba4e 100644 --- a/plugins/mezuro/views/content_viewer/_module_result.rhtml +++ b/plugins/mezuro/views/content_viewer/_module_result.rhtml @@ -18,5 +18,4 @@ <% end %> - - + \ No newline at end of file diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml index eeb076d..b80f86a 100644 --- a/plugins/mezuro/views/content_viewer/show_project.rhtml +++ b/plugins/mezuro/views/content_viewer/show_project.rhtml @@ -71,6 +71,9 @@
<%= render :partial => 'module_result', :locals => { :module_result => @page.module_result(@project.name) } %>
+
+ loading results... +
-- libgit2 0.21.2