diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-07 14:36:01 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-07 14:36:01 +0200 |
commit | 8d8c161a7f1daa92a58194765816b75449769fb1 (patch) | |
tree | ab35ed744ef1d7c122bd1f2afaad4613da4f7dec /app | |
parent | 6c777ff8237e6c0f8628a2997848cd868974560c (diff) | |
download | gitlab-ce-8d8c161a7f1daa92a58194765816b75449769fb1.tar.gz |
Speedup dashboard via loading events with ajax
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/pager.js | 11 | ||||
-rw-r--r-- | app/views/dashboard/_activities.html.haml | 2 | ||||
-rw-r--r-- | app/views/dashboard/index.html.haml | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/app/assets/javascripts/pager.js b/app/assets/javascripts/pager.js index 769e8a62343..7edd6bd6186 100644 --- a/app/assets/javascripts/pager.js +++ b/app/assets/javascripts/pager.js @@ -4,9 +4,16 @@ var Pager = { disable:false, init: - function(limit) { + function(limit, preload) { this.limit=limit; - this.offset=limit; + + if(preload) { + this.offset = 0; + this.getOld(); + } else { + this.offset = limit; + } + this.initLoadMore(); }, diff --git a/app/views/dashboard/_activities.html.haml b/app/views/dashboard/_activities.html.haml index c63ef24fca5..2b7d23c225d 100644 --- a/app/views/dashboard/_activities.html.haml +++ b/app/views/dashboard/_activities.html.haml @@ -7,7 +7,7 @@ = event_filter_link EventFilter.team, 'Team' - if @events.any? - .content_list= render @events + .content_list - else %p.nothing_here_message Projects activity will be displayed here .loading.hide diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index b64aa86cf73..d1422bda617 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -8,4 +8,4 @@ - else = render "zero_authorized_projects" :javascript - $(function(){ Pager.init(20); }); + $(function(){ Pager.init(20, true); }); |