module SimpleFormExtension::Components::Popovers

Public Instance Methods

popover(wrapper_options) click to toggle source
# File lib/simple_form_extension/components/popovers.rb, line 5
def popover(wrapper_options)
  return nil unless options[:popover]

  options = { 
    class: 'btn-popover fa fa-question-circle',
    :rel => 'popover',
    :'data-toggle' => 'popover',
    :'data-container' => 'body',
    :'data-title' => popover_title,
    :'data-content' => popover_content,
    :'data-placement' => popover_position,
    :'data-trigger' => popover_tigger
  }
  
  template.content_tag(:i, '', options)
end
popover_content() click to toggle source
# File lib/simple_form_extension/components/popovers.rb, line 27
def popover_content
  popover_options[:content]
end
popover_position() click to toggle source
# File lib/simple_form_extension/components/popovers.rb, line 31
def popover_position
  popover_options[:position] ||= "auto"
end
popover_tigger() click to toggle source
# File lib/simple_form_extension/components/popovers.rb, line 35
def popover_tigger
  popover_options[:trigger] ||= "click"
end
popover_title() click to toggle source
# File lib/simple_form_extension/components/popovers.rb, line 23
def popover_title
  popover_options[:title]
end

Private Instance Methods

popover_options() click to toggle source
# File lib/simple_form_extension/components/popovers.rb, line 41
def popover_options
  options[:popover] ||= {}
end