Commit 32ebd438c20269004b0d0a50751a955c8aa586f8

Authored by Dmitriy Zaporozhets
1 parent 814eeb45

Issue #263 - dont display ajax loader on commit page if commits < limit

app/controllers/commits_controller.rb
... ... @@ -12,12 +12,12 @@ class CommitsController &lt; ApplicationController
12 12  
13 13 def index
14 14 @repo = project.repo
15   - limit, offset = (params[:limit] || 20), (params[:offset] || 0)
  15 + @limit, @offset = (params[:limit] || 20), (params[:offset] || 0)
16 16  
17 17 @commits = if params[:path]
18   - @repo.log(@ref, params[:path], :max_count => limit, :skip => offset)
  18 + @repo.log(@ref, params[:path], :max_count => @limit, :skip => @offset)
19 19 else
20   - @repo.commits(@ref, limit, offset)
  20 + @repo.commits(@ref, @limit, @offset)
21 21 end
22 22  
23 23 respond_to do |format|
... ...
app/views/commits/index.html.haml
... ... @@ -20,7 +20,8 @@
20 20 .loading{ :style => "display:none;"}
21 21 %center= image_tag "ajax-loader.gif"
22 22  
23   -:javascript
24   - $(function(){
25   - CommitsList.init("#{@ref}", 20);
26   - });
  23 +- if @commits.count == @limit
  24 + :javascript
  25 + $(function(){
  26 + CommitsList.init("#{@ref}", 20);
  27 + });
... ...