diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-27 10:36:28 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-27 10:36:28 +0200 |
commit | 32ebd438c20269004b0d0a50751a955c8aa586f8 (patch) | |
tree | 9a3709c3b668feb05ec1e8423ea4ca928ac8150f | |
parent | 814eeb45e6a4d29a18eee1475d0ebcf69528ddc6 (diff) | |
download | gitlab-ce-32ebd438c20269004b0d0a50751a955c8aa586f8.tar.gz |
Issue #263 - dont display ajax loader on commit page if commits < limit
-rw-r--r-- | app/controllers/commits_controller.rb | 6 | ||||
-rw-r--r-- | app/views/commits/index.html.haml | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 7ca5e3bf7ca..376527394ca 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -12,12 +12,12 @@ class CommitsController < ApplicationController def index @repo = project.repo - limit, offset = (params[:limit] || 20), (params[:offset] || 0) + @limit, @offset = (params[:limit] || 20), (params[:offset] || 0) @commits = if params[:path] - @repo.log(@ref, params[:path], :max_count => limit, :skip => offset) + @repo.log(@ref, params[:path], :max_count => @limit, :skip => @offset) else - @repo.commits(@ref, limit, offset) + @repo.commits(@ref, @limit, @offset) end respond_to do |format| diff --git a/app/views/commits/index.html.haml b/app/views/commits/index.html.haml index 14317b4cb28..fb8d039052b 100644 --- a/app/views/commits/index.html.haml +++ b/app/views/commits/index.html.haml @@ -20,7 +20,8 @@ .loading{ :style => "display:none;"} %center= image_tag "ajax-loader.gif" -:javascript - $(function(){ - CommitsList.init("#{@ref}", 20); - }); +- if @commits.count == @limit + :javascript + $(function(){ + CommitsList.init("#{@ref}", 20); + }); |