class EndView::Bootstrap::Tabpanel

Public Instance Methods

add_pane(*args, &b) click to toggle source
# File lib/end_view/bootstrap/tabpanel.rb, line 16
def add_pane(*args, &b)
  panes << TabPane.new(*args, &b)
end
render(*args, &b) click to toggle source
Calls superclass method
# File lib/end_view/bootstrap/tabpanel.rb, line 20
def render(*args, &b)
  set_active_pane
  super(*args, &b)
end

Private Instance Methods

pane_opts(pane) click to toggle source
# File lib/end_view/bootstrap/tabpanel.rb, line 39
def pane_opts(pane)
  { id: pane.id,
    role: 'tabpanel',
    class: [fade && 'fade',
            fade && pane.active && 'in',
            pane.active] }
end
set_active_pane() click to toggle source
# File lib/end_view/bootstrap/tabpanel.rb, line 27
def set_active_pane
  panes.each { |p| p.active = false }
  panes[active_pane].active = true
end