Class: NavbarPage

Inherits:
UnderOs::Page
  • Object
show all
Defined in:
app/pages/navbar_page.rb

Instance Method Summary collapse

Constructor Details

#initializeNavbarPage

Returns a new instance of NavbarPage.



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/pages/navbar_page.rb', line 2

def initialize
  find('#buttons button').each do |button|
    button.on :tap do
      if button.hasClass('icons')
        navbar.right_buttons = @icons = button.data('icons').split(',').map do |type|
          UnderOs::UI::Icon.new(type: type)
        end
      else
        navbar.right_buttons = {}.tap do |hash|
          button.data('icons').split(',').map do |type|
            hash[type] = Proc.new{ p type }
          end
        end
      end
    end
  end
end