Module: Golden::Theme::Foundation::TabsHelper
- Defined in:
- lib/golden/theme/foundation/tabs_helper.rb
Instance Method Summary collapse
- #foundation_remote_tab_nav(text, url, tag_id, default) ⇒ Object
- #foundation_remote_tab_pane(url, tag_id, default) ⇒ Object
- #foundation_tab_nav(text, tag_id, default) ⇒ Object
- #foundation_tab_pane(tag_id, default) ⇒ Object
- #foundation_tabs(options = {}, &block) ⇒ Object
Instance Method Details
#foundation_remote_tab_nav(text, url, tag_id, default) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/golden/theme/foundation/tabs_helper.rb', line 35 def foundation_remote_tab_nav text, url, tag_id, default active = current_page?(url) || tag_id == default dd_class = 'active' if active = { remote: true, data: { toggle: 'tab', target: "##{tag_id}", type: 'html' } } [ link_to(text, url, ), { class: dd_class } ] end |
#foundation_remote_tab_pane(url, tag_id, default) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/golden/theme/foundation/tabs_helper.rb', line 49 def foundation_remote_tab_pane url, tag_id, default active = current_page?(url) || tag_id == default tab_class = 'content' tab_class << ' active' if active content_tag :div, class: tab_class, id: tag_id do yield active if block_given? end end |
#foundation_tab_nav(text, tag_id, default) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/golden/theme/foundation/tabs_helper.rb', line 14 def foundation_tab_nav text, tag_id, default active = tag_id == default dd_class = 'active' if active = { data: { toggle: 'tab', target: "##{tag_id}" } } [ link_to(text, "##{tag_id}", ), { class: dd_class } ] end |
#foundation_tab_pane(tag_id, default) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/golden/theme/foundation/tabs_helper.rb', line 26 def foundation_tab_pane tag_id, default active = tag_id == default tab_class = 'content' tab_class << ' active' if active content_tag :div, class: tab_class, id: tag_id do yield active if block_given? end end |
#foundation_tabs(options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/golden/theme/foundation/tabs_helper.rb', line 3 def foundation_tabs = {}, &block html_class = .delete :class = { class: "tabs #{html_class}".strip, data: { tab: true } }.deep_merge foundation_dl_tag , &block end |