Skip to content

Commit

Permalink
Only show the batch action panel if there are batch actions. Fixes #1642
Browse files Browse the repository at this point in the history
  • Loading branch information
James McKinney committed Sep 5, 2012
1 parent e2102f9 commit 91e0c91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/active_admin/views/index_as_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IndexAsBlock < ActiveAdmin::Component

def build(page_presenter, collection)
add_class "index"
resource_selection_toggle_panel
resource_selection_toggle_panel if active_admin_config.batch_actions.any?
collection.each do |obj|
instance_exec(obj, &page_presenter.block)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_admin/views/index_as_grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def number_of_columns
protected

def build_table
resource_selection_toggle_panel
resource_selection_toggle_panel if active_admin_config.batch_actions.any?
table :class => "index_grid" do
collection.in_groups_of(number_of_columns).each do |group|
build_row(group)
Expand Down

0 comments on commit 91e0c91

Please sign in to comment.