Module: BarHelper

Defined in:
app/helpers/bar_helper.rb

Instance Method Summary collapse

Instance Method Details

#f7_navbar(html_options = {}, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/bar_helper.rb', line 6

def f7_navbar(html_options={}, &block)
  @f7_bartype = :navbar
  
  html_options[:class] = ([html_options[:class]] || []) << @f7_bartype
  
   :div, html_options do
     :div, :class => ['navbar-inner'] do
      yield if block_given?
    end
  end
end

#f7_toolbar(options = {}, &block) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/helpers/bar_helper.rb', line 18

def f7_toolbar(options={}, &block)
  @f7_bartype = :toolbar
  css_classes = []
  css_classes << @f7_bartype
  css_classes += [options[:class]] if options[:class]
  css_classes.flatten!

  @f7_bartype = :tabbar if options[:type].to_s.include?('tabbar')

  if @f7_bartype == :tabbar
    css_classes << 'tabbar'
    if options[:type] == :tabbar_labels
      css_classes << 'tabbar-labels'
      @has_labels = true
    end
  end
  options[:class] = css_classes
  div_options = options.reject { |k, v| [:type].include? k }

   :div, div_options do
     :div, :class => ['toolbar-inner'] do
      yield if block_given?
    end

  end
end