Permalink
Browse files

Fixes toolbar_button helper loading_indicator option.

  • Loading branch information...
1 parent f665c32 commit 67d55dfc141b70c263ebed8d25cc9e3e6aa18026 Thomas von Deyen committed Sep 14, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/helpers/alchemy/admin/base_helper.rb
@@ -340,7 +340,7 @@ def clipboard_select_tag(items, html_options = {})
# :overlay_options [Hash] # Overlay options. See link_to_overlay_window helper.
# :if_permitted_to [Array] # Check permission for button. [:action, :controller]. Exactly how you defined the permission in your +authorization_rules.rb+. Defaults to controller and action from button url.
# :skip_permission_check [Boolean] # Skip the permission check. Default false. NOT RECOMMENDED!
- # :loading_indicator [Boolean] # Shows the please wait overlay while loading. Default false.
+ # :loading_indicator [Boolean] # Shows the please wait overlay while loading. Only for buttons not opening an overlay window. Default true.
#
def toolbar_button(options = {})
options.symbolize_keys!
@@ -350,7 +350,7 @@ def toolbar_button(options = {})
:active => false,
:link_options => {},
:overlay_options => {},
- :loading_indicator => false
+ :loading_indicator => true
}
options = defaults.merge(options)
button = content_tag('div', :class => 'button_with_label' + (options[:active] ? ' active' : '')) do
@@ -365,7 +365,7 @@ def toolbar_button(options = {})
}
)
else
- link_to options[:url], {:class => "icon_button#{options[:loading_indicator] ? nil : ' please_wait'}", :title => options[:title]}.merge(options[:link_options]) do
+ link_to options[:url], {:class => "icon_button#{options[:loading_indicator] ? ' please_wait' : nil}", :title => options[:title]}.merge(options[:link_options]) do
render_icon(options[:icon])
end
end

0 comments on commit 67d55df

Please sign in to comment.