Commit 32ebd438 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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

parent 814eeb45
......@@ -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|
......
......@@ -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);
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment