Permalink
Browse files

bugfix

  • Loading branch information...
1 parent 638727b commit 47e43221a41fa3d30392e90a7f1706ae6d31fdf6 @mcanato committed Jul 19, 2012
Showing with 5 additions and 8 deletions.
  1. +5 −8 lib/twitter-bootstrap-markup-rails/components/button.rb
@@ -12,7 +12,7 @@ def initialize(text, link, options = {})
def to_s
html_text = ""
- html_text << build_icon.html_safe << ' ' if options[:icon]
+ html_text << build_icon.html_safe << ' ' if options[:icon].blank?
html_text << text
html_text << ' ' << build_caret.html_safe if options[:dropdown]
@@ -30,8 +30,7 @@ def default_options
:disabled => false,
:dropdown => false,
:id => nil,
- :icon_name => nil,
- :icon_color => :black,
+ :icon => {},
:html_options => {}
}
end
@@ -46,12 +45,10 @@ def build_class
end
def build_icon
- if (options[:icon_color].eql?(:white) || options[:type].blank?)
- color = :white
- else
- color = options[:icon_color]
+ if (options[:icon][:color].eql?(:white) || options[:type].blank?)
+ options[:icon] = { :color => :white }
end
- Icon.new(:name => options[:icon_name], :color => color).to_s
+ Icon.new(options[:icon]).to_s
end
def build_caret

0 comments on commit 47e4322

Please sign in to comment.