Sha256: c757b6b2e7cd79e376493a48e6eee7d399c84c55168cf3cf344fcdaa4a960a29

Contents?: true

Size: 786 Bytes

Versions: 14

Compression:

Stored size: 786 Bytes

Contents

module Bootstrap
  class AccordionMenu
    def initialize(view, options = {}, &block)
      options.reverse_merge!(identifier: SecureRandom.urlsafe_base64, icon: 'folder-open')

      @identifier = options.delete(:identifier)
      @title      = options.delete(:title)
      @icon      = options.delete(:icon)
      @view       = view
      @block      = block
    end

    def perform
       items = @view.capture { @block.call(self) }
       @view.render partial: 'bootstrap/accordion_menu', locals: { identifier: @identifier, title: @title, items: items, icon: @icon }
     end

    def item(options = {})
      options.reverse_merge!(icon: nil, target: nil, title: nil, item_count: nil)

      @view.render partial: 'bootstrap/accordion_menu/item', locals: options
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
itsf_backend-5.0.0.pre app/renderers/bootstrap/accordion_menu.rb
itsf_backend-4.2.3 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-4.2.2 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-4.2.1 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-4.2.0 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-4.0.1 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-4.0.0 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.1.1 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.1.0 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.0.7 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.0.6 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.0.5 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.0.4 app/renderers/bootstrap/accordion_menu.rb
itsf_backend-3.0.3 app/renderers/bootstrap/accordion_menu.rb