lib/bootstrap/view_helpers/components/modal.rb in bootstrap-view_helpers-0.0.2 vs lib/bootstrap/view_helpers/components/modal.rb in bootstrap-view_helpers-0.0.3
- old
+ new
@@ -16,11 +16,11 @@
end
end
def header(title_or_options = nil, header_options = {}, &block)
header_options = title_or_options || {} if block.present?
- title_or_options = nil if block.blank?
+ title_or_options = nil if block.present?
header_options[:title] ||= title_or_options || title_text
header_options[:dismiss] ||= dismiss
Header.new(view, header_options, &block).to_html
end
@@ -48,10 +48,11 @@
SecureRandom.urlsafe_base64
end
def dialog_options
class_name = "modal-dialog#{' modal-dialog-centered' if centered}"
+ class_name << " modal-#{size}" if size.present?
{ class: class_name, role: 'document' }
end
def content_options
{ class: 'modal-content' }
@@ -70,10 +71,9 @@
@render_body ||= options.delete(:body)
end
def inject_class_name_to_options
options[:class] = "#{options[:class]} modal#{fade}#{show}"
- options[:class] << " modal-#{size}" if size.present?
options[:class].strip!
end
def parse_html_options
@centered = options.delete(:centered)