OSDN Git Service

Limit amount of contributors at graph to 100 persons
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 25 Jun 2013 14:34:50 +0000 (17:34 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 25 Jun 2013 14:34:50 +0000 (17:34 +0300)
app/assets/javascripts/stat_graph_contributors.js.coffee
app/views/projects/graphs/show.html.haml

index 6cf6f1f..5b4b3da 100644 (file)
@@ -12,7 +12,8 @@ class window.ContributorsStatGraph
     @master_graph.draw()
   add_authors_graph: (author_data) ->
     @authors = []
-    _.each(author_data, (d) =>
+    limited_author_data = author_data.slice(0, 100)
+    _.each(limited_author_data, (d) =>
       author_header = @create_author_header(d)
       $(".contributors-list").append(author_header)
       @authors[d.author] = author_graph = new ContributorsAuthorGraph(d.dates)
index 05bc143..6593319 100644 (file)
@@ -24,8 +24,8 @@
     type: "GET",
     url: location.href,
     complete: function() {
+      $(".stat-graph").fadeIn();
       $(".loading-graph").hide();
-      $(".stat-graph").show();
     },
     dataType: "script"
   });