Commit 32ebd438c20269004b0d0a50751a955c8aa586f8
1 parent
814eeb45
Exists in
master
and in
4 other branches
Issue #263 - dont display ajax loader on commit page if commits < limit
Showing
2 changed files
with
8 additions
and
7 deletions
Show diff stats
app/controllers/commits_controller.rb
... | ... | @@ -12,12 +12,12 @@ class CommitsController < 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 | + }); | ... | ... |