Class: SidebarsPage

Inherits:
UnderOs::Page show all
Defined in:
app/pages/sidebars_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

#initializeSidebarsPage

Returns a new instance of SidebarsPage.



2
3
4
5
6
7
8
9
# File 'app/pages/sidebars_page.rb', line 2

def initialize
  first('#top'   ).on(:tap){ show_on_top    }
  first('#left'  ).on(:tap){ show_on_left   }
  first('#right' ).on(:tap){ show_on_right  }
  first('#bottom').on(:tap){ show_on_bottom }

  @sidebar = first('sidebar#test')
end

Instance Method Details

#show_on_bottomObject



35
36
37
38
39
40
41
# File 'app/pages/sidebars_page.rb', line 35

def show_on_bottom
  return @sidebar.hide if @sidebar.visible?

  @sidebar.location = :bottom
  @sidebar.style.height = 100
  @sidebar.show
end

#show_on_leftObject



19
20
21
22
23
24
25
# File 'app/pages/sidebars_page.rb', line 19

def show_on_left
  return @sidebar.hide if @sidebar.visible?

  @sidebar.location = :left
  @sidebar.style.width = 200
  @sidebar.show
end

#show_on_rightObject



27
28
29
30
31
32
33
# File 'app/pages/sidebars_page.rb', line 27

def show_on_right
  return @sidebar.hide if @sidebar.visible?

  @sidebar.location = :right
  @sidebar.style.width = 200
  @sidebar.show
end

#show_on_topObject



11
12
13
14
15
16
17
# File 'app/pages/sidebars_page.rb', line 11

def show_on_top
  return @sidebar.hide if @sidebar.visible?

  @sidebar.location = :top
  @sidebar.style.height = 100
  @sidebar.show
end