Permalink
Browse files

fixing

  • Loading branch information...
1 parent 8fd558f commit 4359109ed8dfb38832fb38bffbed9fca639cb793 @mcanato committed Jul 24, 2012
@@ -15,16 +15,17 @@ def to_s
private
def default_options
{
- :class => "badge",
- :bootstrap_class_prefix => "badge-",
+ :class => nil,
+ :bootstrap_class_prefix => "badge",
:type => nil,
:html_options => {}
}
end
def build_class
classes = [ options[:class] ]
- classes << "#{options[:bootstrap_class_prefix]}#{options[:type]}" if options[:type]
+ classes << options[:bootstrap_class_prefix]
+ classes << "#{options[:bootstrap_class_prefix]}-#{options[:type]}" if options[:type]
classes.join(" ")
end
@@ -1,7 +1,6 @@
module Twitter::Bootstrap::Markup::Rails::Components
class Button < Base
include ActionView::Helpers::UrlHelper
- include ActionDispatch::Routing::UrlFor
attr_reader :text
@@ -24,8 +23,8 @@ def to_s
private
def default_options
{
- :class => "btn",
- :bootstrap_class_prefix => "btn-",
+ :class => nil,
+ :bootstrap_class_prefix => "btn",
:type => nil,
:size => nil,
:disabled => false,
@@ -39,8 +38,9 @@ def default_options
def build_class
classes = [ options[:class] ]
- classes << "#{options[:bootstrap_class_prefix]}#{options[:type]}" if options[:type]
- classes << "#{options[:bootstrap_class_prefix]}#{options[:size]}" if options[:size]
+ classes << options[:bootstrap_class_prefix]
+ classes << "#{options[:bootstrap_class_prefix]}-#{options[:type]}" if options[:type]
+ classes << "#{options[:bootstrap_class_prefix]}-#{options[:size]}" if options[:size]
classes << 'dropdown-toggle' if options[:dropdown]
classes << 'disabled' if options[:disabled]
classes.join(" ")
@@ -14,7 +14,7 @@ def to_s
def default_options
{
:class => nil,
- :bootstrap_class_prefix => "icon-",
+ :bootstrap_class_prefix => "icon",
:icon_white => false,
:name => nil,
:html_options => {}
@@ -23,8 +23,9 @@ def default_options
def build_class
classes = [ options[:class] ]
- classes << "#{options[:bootstrap_class_prefix]}#{options[:name]}" if options[:name]
- classes << "#{options[:bootstrap_class_prefix]}white" if options[:icon_white]
+ classes << options[:bootstrap_class_prefix]
+ classes << "#{options[:bootstrap_class_prefix]}-#{options[:name]}" if options[:name]
+ classes << "#{options[:bootstrap_class_prefix]}-white" if options[:icon_white]
classes.join(" ")
end
@@ -13,18 +13,20 @@ def to_s
end
private
+
def default_options
{
- :class => "label",
- :bootstrap_class_prefix => "label-",
+ :class => nil,
+ :bootstrap_class_prefix => "label",
:type => nil,
:html_options => {}
}
end
def build_class
classes = [ options[:class] ]
- classes << "#{options[:bootstrap_class_prefix]}#{options[:type]}" if options[:type]
+ classes << options[:bootstrap_class_prefix]
+ classes << "#{options[:bootstrap_class_prefix]}-#{options[:type]}" if options[:type]
classes.join(" ")
end
@@ -20,8 +20,13 @@ def to_s
end
private
+
def default_options
- {:dom_id => 'twitter-bootstrap-modal', :fade => false, :header_title => ''}
+ {
+ :dom_id => 'twitter-bootstrap-modal',
+ :fade => false,
+ :header_title => ''
+ }
end
def modal_classes
@@ -30,7 +30,7 @@ def default_options
def build_html_class(element)
html_class = {}
if element.options[:active_nav]
- element.options.reject! {|k,v| k == :active_nav }
+ element.options.reject! { |k| k == :active_nav }
html_class = { :class => "active" }
end
html_class
@@ -18,14 +18,23 @@ def to_s
def default_options
{
- :class => 'progress',
+ :class => nil,
+ :bootstrap_class_prefix => "progress",
:type => [],
:html_options => {}
}
end
+ def build_class
+ classes = [ options[:class] ]
+ classes << options[:bootstrap_class_prefix]
+ classes << "#{options[:bootstrap_class_prefix]}-#{options[:type]}" if options[:type]
+ classes << "active" if options[:active]
+ classes.join(" ")
+ end
+
def build_bar_tag
- ops = { :class => 'bar', :style => "width: #{width}%;" }
+ ops = { :class => 'bar', :style => "width: #{@width}%;" }
content_tag(:div, nil, ops)
end
@@ -34,18 +43,6 @@ def build_div_options
ops.reverse_merge(options[:html_options])
end
- def build_class
- classes = [options[:class]]
- if options[:type].is_a?(Array)
- classes = classes | options[:type].map { |c| "progress-#{c.to_s}" }
- else
- classes << "progress-#{options[:type]}"
- end
-
- classes << "active" if options[:active]
-
- classes.join(" ")
- end
end
end

0 comments on commit 4359109

Please sign in to comment.