Sha256: a08853baa2a249ad092b1adb60ec9d5a7c15abc7b5182f092eae75a0f3e07e38

Contents?: true

Size: 793 Bytes

Versions: 2

Compression:

Stored size: 793 Bytes

Contents

module BootstrapIt
  #
  module ViewHelpers
    #
    # Dropdown Menu
    #
    # @author [alexiss]
    #
    class DropdownMenu < WrapIt::Container
      default_tag 'ul'
      html_class 'dropdown-menu'

      child :divider, ListItem,
            [tag: 'li', class: 'divider', role: 'presentation']
      child :header, ListItem,
            [tag: 'li', class: 'dropdown-header', role: 'presentation']
      child :link_item, ListLinkItem,
            [li_role: 'presentation', role: 'menuitem', tabindex: '-1']

      after_initialize do
        @options['role'] = 'menu'
        if @options.delete(:align).to_s.downcase == 'right'
          add_html_class('pull-right')
        end
      end
    end

    WrapIt.register :dropdown_menu, 'BootstrapIt::ViewHelpers::DropdownMenu'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap_it-0.1.1 lib/bootstrap_it/view_helpers/dropdown_menu.rb
bootstrap_it-0.1.0 lib/bootstrap_it/view_helpers/dropdown_menu.rb