Class: CollectionsPage

Inherits:
UnderOs::Page show all
Defined in:
app/pages/collections_page.rb

Instance Attribute Summary

Attributes inherited from UnderOs::Page

#_, #stylesheet

Instance Method Summary collapse

Methods inherited from UnderOs::Page

#alert, #build_layout, #compile_styles, #history, layout, #name, #navbar, new, #repaint, #setup_wrap, #title, #title=, #view, #view=

Methods included from UnderOs::Events

#emit, #off, #on

Constructor Details

#initializeCollectionsPage

Returns a new instance of CollectionsPage.



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/pages/collections_page.rb', line 2

def initialize
  @collection = first('collection')
  @collection.number_of_items  = 1000
  @collection.on :item do |item, index|
    item.children[0].text = "##{index + 1}"
  end
  @collection.on :select do |item|
    item.addClass 'selected'
  end
  @collection.on :unselect do |item|
    item.removeClass 'selected'
  end
end