Commit cbdb8c12c457b8329344816a5746c52abe296b16
Committed by
Paulo Meireles
1 parent
c32aa8a5
Exists in
master
and in
29 other branches
[mezuro] Now project page processing has loading animation
Showing
2 changed files
with
6 additions
and
5 deletions
Show diff stats
plugins/mezuro/public/javascripts/project_content.js
1 | 1 | var processingTree = false; |
2 | 2 | jQuery(function (){ |
3 | 3 | jQuery('.source-tree-link').live("click", reloadModule); |
4 | + showLoadingProcess(true); | |
4 | 5 | showProjectContent(); |
5 | 6 | }); |
6 | 7 | |
... | ... | @@ -10,7 +11,7 @@ function showProjectContent() { |
10 | 11 | |
11 | 12 | function reloadModule(){ |
12 | 13 | var module_name = jQuery(this).attr('data-module-name'); |
13 | - showLoadingProcess(); | |
14 | + showLoadingProcess(false); | |
14 | 15 | processingTree = true; |
15 | 16 | callAction('project_tree', {module_name: module_name }, showProjectTree); |
16 | 17 | callAction('module_result', {module_name: module_name}, showModuleResult); |
... | ... | @@ -31,10 +32,8 @@ function showProjectContentFor(state){ |
31 | 32 | |
32 | 33 | function showProjectContentAfter(seconds){ |
33 | 34 | if (seconds > 0){ |
34 | - alert("Not ready. Trying again in " + seconds + " seconds"); | |
35 | 35 | setTimeout(function() { showProjectContentAfter(seconds - 10);}, 10000); |
36 | 36 | } else { |
37 | - alert("Trying now..."); | |
38 | 37 | showProjectContent(); |
39 | 38 | } |
40 | 39 | } |
... | ... | @@ -65,7 +64,10 @@ function projectContentData(data){ |
65 | 64 | return jQuery('#project-result').attr('data-' + data); |
66 | 65 | } |
67 | 66 | |
68 | -function showLoadingProcess(){ | |
67 | +function showLoadingProcess(firstLoad){ | |
68 | + if(firstLoad) | |
69 | + showProjectResult("<img src='/images/loading-small.gif'/>"); | |
70 | + | |
69 | 71 | showProjectTree("<img src='/images/loading-small.gif'/>"); |
70 | 72 | showModuleResult("<img src='/images/loading-small.gif'/>"); |
71 | 73 | } | ... | ... |