end
end
+ helper_method :next_page_href
+ def next_page_href with_params={}
+ if next_page_offset
+ url_for with_params.merge(offset: next_page_offset)
+ end
+ end
+
def show
if !@object
return render_not_found("object not found")
locals: {
multiple: params[:multiple]
}),
- next_page_href: @next_page_href
+ next_page_href: next_page_href(partial: params[:partial])
}
}
end
@objects = Link.filter(filter)
find_objects_for_index
- @next_page_href = (next_page_offset and
- url_for(offset: next_page_offset, partial: true))
@name_links = @objects
@objects = Collection.
@objects = Group.contents(limit: @limit, offset: @offset, filters: @filters)
super
end
+
+ def next_page_href with_params={}
+ super with_params.merge(last_object_class: @objects.last.class.to_s)
+ end
end
style="height: 100%; overflow-y: scroll"
data-infinite-scroller="#choose-scroll"
id="choose-scroll"
- data-infinite-content-href="<%= @next_page_href %>">
+ data-infinite-content-href="<%= next_page_href partial: true %>">
<%= render partial: 'choose_rows', locals: {multiple: multiple} %>
</div>
<div class="col-sm-6 modal-dialog-preview-pane" style="height: 100%; overflow-y: scroll">
-<% current_class = nil %>
+<% current_class = params[:last_object_class] %>
<% @objects.each do |object| %>
<% icon_class = fa_icon_class_for_class(object.class) %>
- <% if object.class != current_class %>
- <% current_class = object.class %>
+ <% if object.class.to_s != current_class %>
+ <% current_class = object.class.to_s %>
<div class="row class-separator">
<div class="col-sm-12">
<%= object.class_for_display.pluralize.downcase %>