diff --git a/pagure/static/issues_stats.js b/pagure/static/issues_stats.js index 8b861f1..b8e63b9 100644 --- a/pagure/static/issues_stats.js +++ b/pagure/static/issues_stats.js @@ -57,17 +57,6 @@ function issues_history_stats_plot(url, _b, _s) { }); } -function wait_for_task(url, callback) { - $.get(url) - .done(function(data){ - callback(data); - $("#data_stats_spinner").hide(); - }) - .fail(function(){ - window.setTimeout(wait_for_task(url, callback), 1000); - }); -} - function show_commits_authors(data) { var _b = $("#data_stats"); var html = '
Since ' @@ -157,3 +146,14 @@ function process_async(url, _data, callback) { wait_for_task(data.url, callback); }) } + +function wait_for_task(url, callback) { + $.get(url) + .done(function(data){ + callback(data); + $("#data_stats_spinner").hide(); + }) + .fail(function(){ + window.setTimeout(function() {wait_for_task(url, callback);}, 1000); + }); +}