Sha256: 34e3a3ef6d8deae487186d2a08ef07e8176c650a62e76df58309464bac4f3c00

Contents?: true

Size: 466 Bytes

Versions: 22

Compression:

Stored size: 466 Bytes

Contents

class SidebarTableSection < Prime::TableSection
  def sidebar_items
    [
      {title: 'Home Screen', action: :open_home},
      {title: 'Help Screen', action: :open_help}
    ]
  end

  def table_data
    sidebar_items.map do |model|
      SidebarActionSection.new(model: model)
    end
  end

  def on_click(table, index)
    section = data[index.row]
    return false if !section || !section.model[:action]
    screen.send section.model[:action].to_sym
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
motion-prime-0.7.2 files/app/sections/sidebar/table.rb
motion-prime-0.7.1 files/app/sections/sidebar/table.rb
motion-prime-0.7.0 files/app/sections/sidebar/table.rb
motion-prime-0.6.0 files/app/sections/sidebar/table.rb
motion-prime-0.5.7 files/app/sections/sidebar/table.rb
motion-prime-0.5.6 files/app/sections/sidebar/table.rb
motion-prime-0.5.5 files/app/sections/sidebar/table.rb
motion-prime-0.5.4 files/app/sections/sidebar/table.rb
motion-prime-0.5.3 files/app/sections/sidebar/table.rb
motion-prime-0.5.2 files/app/sections/sidebar/table.rb
motion-prime-0.5.1 files/app/sections/sidebar/table.rb
motion-prime-0.5.0 files/app/sections/sidebar/table.rb
motion-prime-0.4.5 files/app/sections/sidebar/table.rb
motion-prime-0.4.4 files/app/sections/sidebar/table.rb
motion-prime-0.4.3 files/app/sections/sidebar/table.rb
motion-prime-0.4.2 files/app/sections/sidebar/table.rb
motion-prime-0.4.1 files/app/sections/sidebar/table.rb
motion-prime-0.4.0 files/app/sections/sidebar/table.rb
motion-prime-0.3.3 files/app/sections/sidebar/table.rb
motion-prime-0.3.2 files/app/sections/sidebar/table.rb