app/helpers/bootstrap/modal_helper.rb in bootstrap-view-helpers-0.0.13 vs app/helpers/bootstrap/modal_helper.rb in bootstrap-view-helpers-0.0.14

- old
+ new

@@ -14,15 +14,19 @@ # Returns a Bootstrap modal dialog def modal(options={}) options = canonicalize_options(options) options.has_key?(:id) or raise(ArgumentError, "missing :id option") - options = ensure_class(options, %w(modal hide fade)) + options = ensure_class(options, %w(modal fade)) options.merge!(tabindex: "-1", role: "dialog") content_tag(:div, options) do - yield + content_tag(:div, class: "modal-dialog") do + content_tag(:div, class: "modal-content") do + yield + end + end end end # Returns a DIV for Bootstrap modal header def modal_header(*args, &block) @@ -32,11 +36,11 @@ content = block_given? ? capture(&block) : args.shift content_tag(:div, options) do modal_header_close_button(show_close) + - content_tag(:h3) do + content_tag(:h4, class: "modal-title") do content end end end @@ -71,10 +75,12 @@ end # Returns a Bootstrap modal close button def modal_header_close_button(show=true) return ''.html_safe unless show - button("×".html_safe, type: 'button', class: 'close modal-close modal-header-close', data: {dismiss: 'modal'}) + button(type: 'button', class: 'close', data: {dismiss: 'modal'}) do + content_tag(:span, "×".html_safe) + end end # Returns a close button for Bootstrap modal footer. def modal_footer_close_button(*args) options = canonicalize_options(args.extract_options!) \ No newline at end of file