Method: Forma::Form#tab_element

Defined in:
lib/forma/form.rb

#tab_element(tab) ⇒ Object



167
168
169
170
171
172
173
174
175
176
177
# File 'lib/forma/form.rb', line 167

def tab_element(tab)
  hasSecondCol = (not tab.col2.fields.empty?)
  col1 = column_element(tab.col1, hasSecondCol)
  col2 = column_element(tab.col2, hasSecondCol)
  el('div', attrs: { class: 'ff-tab-content',style: ({ display: 'none' } if @tabs.index(tab) != @selected_tab) },
    children: [
      tab_actions(tab),
      el('div', attrs: { class: 'ff-cols'}, children: [col1, col2])
    ]
  )
end