Class: ODDB::View::TabNavigation

Inherits:
HtmlGrid::Composite show all
Defined in:
src/view/tab_navigation.rb

Constant Summary

COMPONENTS =
{}
CSS_CLASS =
"component tabnavigation right"
SYMBOL_MAP =

HTML_ATTRIBUTES = { “align”=>“center” }

{
  :tabnavigation_divider  => HtmlGrid::Text,
}

Instance Method Summary (collapse)

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) build_custom_navigation



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'src/view/tab_navigation.rb', line 38

def build_custom_navigation
  @lookandfeel.zones.each_with_index { |zone, idx|
    if(zone.is_a?(Class))
      zone = zone.direct_event
      symbol_map.store(zone, View::NavigationLink)
    else
      symbol_map.store(zone, View::TabNavigationLink)
    end
    pos = [idx*2,0]
    components.store(pos, zone)
    component_css_map.store(pos, 'tabnavigation')
    if(idx > 0)
      components.store([idx*2-1,0], :tabnavigation_divider) 
    end
  }
end

- (Object) build_navigation



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'src/view/tab_navigation.rb', line 25

def build_navigation
  @lookandfeel.zones.sort_by { |zone| 
    @lookandfeel.lookup(zone)
  }.each_with_index { |zone, idx|
    symbol_map.store(zone, View::TabNavigationLink)
    pos = [idx*2,0]
    components.store(pos, zone)
    component_css_map.store(pos, 'tabnavigation')
    if(idx > 0)
      components.store([idx*2-1,0], :tabnavigation_divider) 
    end
  }
end

- (Object) init



17
18
19
20
21
22
23
24
# File 'src/view/tab_navigation.rb', line 17

def init
  if(@lookandfeel.enabled?(:custom_tab_navigation, false))
    build_custom_navigation()
  else
    build_navigation()
  end
  super
end

- (Object) to_html(context)



54
55
56
57
58
59
60
# File 'src/view/tab_navigation.rb', line 54

def to_html(context)
  if(components.empty?)
    " "
  else
    super
  end
end