Module: Tungsten::TableHelper

Defined in:
app/helpers/tungsten/table_helper.rb

Defined Under Namespace

Classes: TableDrawer

Instance Method Summary collapse

Instance Method Details

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



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/tungsten/table_helper.rb', line 3

def tr_drawer(id, options = {}, &block)

  colspan = options.delete(:colspan) || 100
  options[:class] = "#{options[:class]} table-drawer-content toggle-drawer".strip
  options[:animate] = 'drawer' if options[:animate].nil?

  (:tr, class: "table-drawer") {
    (:td, colspan: colspan) {
      drawer(id, { class: "table-drawer-content-wrapper", hidden: options.delete(:hidden), animate: options.delete(:animate) }) {
        (:div, options, &block)
      }
    }
  }
end